Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Input as function parameter
#1
When we have a function like this:

def function(param1, input=""):
    ...
What´s the variable of that input? How can I use it´s value inside that function?
Reply
#2
input is a python builtin_function_or_method class, and should never be used as an attribute this way.
Rename input to xinput or some other name, and change where it is used in the function as well.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  difference between forms of input a list to function akbarza 6 1,014 Feb-21-2024, 08:02 PM
Last Post: bterwijn
  determine parameter type in definition function akbarza 1 579 Aug-24-2023, 01:46 PM
Last Post: deanhystad
  Function parameter not writing to variable Karp 5 921 Aug-07-2023, 05:58 PM
Last Post: Karp
  [ERROR] ParamValidationError: Parameter validation failed: Invalid type for parameter gdbengo 3 10,940 Dec-26-2022, 08:48 AM
Last Post: ibreeden
Information How to take url in telegram bot user input and put it as an argument in a function? askfriends 0 1,072 Dec-25-2022, 03:00 PM
Last Post: askfriends
  Showing an empty chart, then input data via function kgall89 0 973 Jun-02-2022, 01:53 AM
Last Post: kgall89
  input function question barryjo 12 2,703 Jan-18-2022, 12:11 AM
Last Post: barryjo
  function with 'self' input parameter errors out with and without 'self' called dford 12 3,076 Jan-15-2022, 06:07 PM
Last Post: deanhystad
  Problem with input after function luilong 10 4,072 Dec-04-2021, 12:16 AM
Last Post: luilong
  Exit function from nested function based on user input Turtle 5 2,891 Oct-10-2021, 12:55 AM
Last Post: Turtle

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020