Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Function
#2
every function returns something. if it does not return anything explicitly, it returns None. That is the case with your function h - it does not return anything explicitly, so it return None
on line 3, it first call function h, it prints hey - that is the first line of the output and returns None, so your print function actually gets a 2 element tuple - None, 'hello' and prints it (that is the second line of the output)
Reply


Messages In This Thread
Function - by AmanTripathi - Feb-01-2018, 07:05 PM
RE: Function - by buran - Feb-01-2018, 07:11 PM
RE: Function - by AmanTripathi - Feb-02-2018, 04:30 AM

Forum Jump:

User Panel Messages

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