Python Forum
Defining a function with input
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Defining a function with input
#3
(Feb-10-2021, 10:15 PM)BashBedlam Wrote: First, radius is going to be a string and you want an integer.

It's correct that input returns str but radius can be integer as well as float.

For OP I suggest to follow conventions set in PEP8 for function naming (circle_area).

Regarding original question:

>>> def my_func():
...     print('This is my_func')
...
>>> my_func
<function my_func at 0x7fce15136c10>
>>> my_func()
This is my_func
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Messages In This Thread
Defining a function with input - by abcd - Feb-10-2021, 10:09 PM
RE: Defining a function with input - by BashBedlam - Feb-10-2021, 10:15 PM
RE: Defining a function with input - by perfringo - Feb-10-2021, 10:29 PM
RE: Defining a function with input - by deanhystad - Feb-10-2021, 10:52 PM
RE: Defining a function with input - by abcd - Feb-20-2021, 11:11 PM
RE: Defining a function with input - by NullAdmin - Feb-21-2021, 02:34 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  difference between forms of input a list to function akbarza 6 1,113 Feb-21-2024, 08:02 PM
Last Post: bterwijn
Information How to take url in telegram bot user input and put it as an argument in a function? askfriends 0 1,143 Dec-25-2022, 03:00 PM
Last Post: askfriends
  Showing an empty chart, then input data via function kgall89 0 997 Jun-02-2022, 01:53 AM
Last Post: kgall89
  input function question barryjo 12 2,787 Jan-18-2022, 12:11 AM
Last Post: barryjo
  function with 'self' input parameter errors out with and without 'self' called dford 12 3,201 Jan-15-2022, 06:07 PM
Last Post: deanhystad
  Problem with input after function luilong 10 4,161 Dec-04-2021, 12:16 AM
Last Post: luilong
  Exit function from nested function based on user input Turtle 5 2,964 Oct-10-2021, 12:55 AM
Last Post: Turtle
Star I'm getting syntax error while using input function in def. yecktmpmbyrv 1 2,001 Oct-06-2021, 09:39 AM
Last Post: menator01
  Conjugate Gradient having issues with defining A (function to solve [A]{x} = {b} ) DimosG 2 2,854 Sep-21-2021, 08:32 PM
Last Post: 1968Edwards
  Input function cutting off commands at spaces. throwaway34 3 2,238 May-12-2021, 06:40 AM
Last Post: throwaway34

Forum Jump:

User Panel Messages

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