Python Forum
Function returns memory address
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Function returns memory address
#1
I'm really new to Python and am going through a training course :). The course is walking us through basic functionality. I'm using Python 3.7.2 on a Mac.

Here's the code I'm using and the result. It doesn't appear to be an error, just not the result I was looking for.
>>> def age():
	user_age = input("Enter: ")
	print("you are {}".format(user_age))
Error:
<function age at 0x110912f28>
Thanks!

Whoops, beginner mistake. Forgot to use the () at the end of the function name. *face palm*
Reply
#2
you need to indent lines 2 & 3
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  function returns dataframe as list harum 2 1,393 Aug-13-2022, 08:27 PM
Last Post: rob101
  function accepts infinite parameters and returns a graph with those values edencthompson 0 855 Jun-10-2022, 03:42 PM
Last Post: edencthompson
  function that returns a list of dictionaries nostradamus64 2 1,740 May-06-2021, 09:58 PM
Last Post: nostradamus64
  Recursive function returns None, when True is expected akar 0 3,383 Sep-07-2020, 07:58 PM
Last Post: akar
  Python function returns inconsistent results bluethundr 4 3,184 Dec-21-2019, 02:11 AM
Last Post: stullis
  Function returns "NoneType" eoins 3 5,197 May-22-2019, 10:43 PM
Last Post: micseydel
  Function returns unaccurate value raulfloresgp 4 2,959 Nov-23-2018, 03:39 AM
Last Post: raulfloresgp

Forum Jump:

User Panel Messages

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