Python Forum
Input as not default method parameter
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Input as not default method parameter
#4
Within the function you reference param1 as param1, and input as input. That's what the def line does, it defines the names for the parameters given, and any defaults.

Note that input is a bad parameter name. There is a built-in function named input. If you name a parameter input, then you can't access the built-in input from within the function. That may not be a problem here, but it's a good thing to avoid in general.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Input as not default method parameter - by dan789 - Mar-08-2019, 12:26 PM
RE: Input as not default method parameter - by ichabod801 - Mar-08-2019, 08:29 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [ERROR] ParamValidationError: Parameter validation failed: Invalid type for parameter gdbengo 3 12,010 Dec-26-2022, 08:48 AM
Last Post: ibreeden
  Zfill Method Parameter Confusion new_coder_231013 3 1,201 Dec-05-2022, 05:52 PM
Last Post: new_coder_231013
  function with 'self' input parameter errors out with and without 'self' called dford 12 3,451 Jan-15-2022, 06:07 PM
Last Post: deanhystad
  [SOLVED] Input parameter: Single file or glob? Winfried 0 1,653 Sep-10-2021, 11:54 AM
Last Post: Winfried
  what would you call the input for the parameter(s) of a function you have defined? rix 3 2,595 Dec-16-2019, 12:04 AM
Last Post: rix
  def function default parameter expressions Skaperen 2 2,651 Aug-22-2019, 10:58 PM
Last Post: Skaperen
  Default setting for custom name input characteristics? beardelune 2 2,084 Aug-09-2019, 06:24 PM
Last Post: beardelune
  sqlite3 question - execute method with :parameter richalt2 2 7,796 May-20-2019, 05:35 PM
Last Post: woooee
  How to use a string method on user input Exsul 2 2,768 Mar-17-2019, 08:12 PM
Last Post: Exsul
  Input as function parameter dan789 1 2,175 Mar-08-2019, 05:19 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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