Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Output issue
#2
The default return value from a function is None, when the if is true it does not return anything so it defaults to None
Instead of printing you can return the string and then it would print the returned string
print (name, "was born in",2018 - age)
change to
return f'{name}, was born in,{2018-age}'
Reply


Messages In This Thread
Output issue - by twinpiques - Jul-29-2019, 10:23 PM
RE: Output issue - by Yoriz - Jul-29-2019, 10:48 PM
RE: Output issue - by cvsae - Jul-29-2019, 10:52 PM
RE: Output issue - by twinpiques - Jul-29-2019, 11:15 PM
RE: Output issue - by Yoriz - Jul-29-2019, 11:16 PM
RE: Output issue - by twinpiques - Jul-29-2019, 11:21 PM
RE: Output issue - by Yoriz - Jul-29-2019, 11:24 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  multithreading issue with output mr_byte31 4 3,228 Sep-11-2019, 12:04 PM
Last Post: stullis
  re.finditer issue, output is blank anna 1 2,385 Feb-07-2019, 10:41 AM
Last Post: stranac
  Paramiko output printing issue anna 3 16,089 Feb-06-2018, 08:34 AM
Last Post: anna
  Encoding issue for the console output ted_chou12 4 3,480 Sep-08-2017, 09:11 AM
Last Post: ted_chou12

Forum Jump:

User Panel Messages

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