Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8884255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:01:15+00:00 2026-06-14T21:01:15+00:00

I want to have some sort of reference to a function but I do

  • 0

I want to have some sort of reference to a function but I do not know if I need to use a def f(x) or a lambda of some kind.

For instance I’d like to print f(3) and have it output 9a, or is this not how python works?

Second question: Assuming I have a working function, how do I return the degree of it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T21:01:15+00:00Added an answer on June 14, 2026 at 9:01 pm

    To create a function, you define it. Functions can do anything, but their primary use pattern is taking parameters and returning values. You have to decide how exactly it transforms parameters into the return value.

    For instance, if you want f(x) to return a number, then a should also be a numeric variable defined globally or inside the function:

    In [1]: def f(x):
       ...:     a = 2.5
       ...:     return a * x**2
       ...: 
    
    In [2]: f(3)
    Out[2]: 22.5
    

    Or maybe you want it to return a string like this:

    In [3]: def f(x):
       ...:     return str(x**2) + 'a'
       ...: 
    
    In [4]: f(3)
    Out[4]: '9a'
    

    You have to specify your needs if you need more help.


    EDIT: As it turns out, you want to work with polynomials or algebraic functions as objects and do some algebraic stuff with them. Python will allow doing that, but not using standard data types. You can define a class for a polynomial and then define any methods or functions to get the highest power or anything else. But Polynomial is not a built-in data type. There may be some good libraries defining such classes, though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Horrible title, I know. I want to have some kind of wordwrap, but obviously
Introduction I have some sort of values that I might want to access several
I want to have some kind of single list that is initialized in a
Some background: I have an database that I want to use linq-to-sql to update
I have some text which I want to have on separate lines. I try
I have a class and I want to have some bit masks with values
if i want to have some text show up in a calligraphy font, how
I am writing some BASH script and I want it have some error handling
I'm using Sublime Text 2 and SublimeCodeIntel plugin. I want to have some code
On an Android View, I want to have a some clickable text that works

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.