Python Forum
python prints none in function output
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python prints none in function output
#1
i'll attach screenshots but basically i'm making a text-based adventure game for my bridging work for sixth form and idk just look i've tried like returning the first variable but i just dont know how to get rid of the None im begging for help its annoying me so much        
p.s pls dont bully my story writing abilities im doing my best !!
Yoriz write Jul-07-2021, 06:59 PM:
Please post all code, output and errors (in their entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Reply
#2
The second line in your beginning () function is what's causing the problem. Specifically it's the print statement inside of the input statement.

This is returning None:

this = input (print ('that'))
print ('this')
This is returning the user input:

this = input ('that')
print ('this')
chairmanme0wme0w likes this post
Reply
#3
(Jul-07-2021, 04:36 PM)BashBedlam Wrote: The second line in your beginning () function is what's causing the problem. Specifically it's the print statement inside of the input statement.

This is returning None:

this = input (print ('that'))
print ('this')
This is returning the user input:

this = input ('that')
print ('this')

thank you so much!! this helped alot Big Grin
Reply
#4
I'll just bully you over your choice of text highlight colors. Unreadable! In the future please post code to the forum, not screen shots.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  output correction using print() function afefDXCTN 3 3,154 Sep-18-2021, 06:57 PM
Last Post: Sky_Mx
  print function output wrong with strings. mposwal 5 828 Feb-12-2021, 09:04 AM
Last Post: DPaul
  Output prints Account.id at the end? LastStopDEVS 5 764 Dec-19-2020, 05:59 AM
Last Post: buran
  Output with none, print(x) in function Vidar567 3 611 Nov-24-2020, 05:40 PM
Last Post: deanhystad
  Try/Exept prints only ones tester_V 11 999 Nov-03-2020, 02:38 AM
Last Post: tester_V
  How to append to list a function output? rama27 5 1,335 Aug-24-2020, 10:53 AM
Last Post: DeaD_EyE
  python display with '\\' when prints with key-value in dictionary maiya 12 2,974 May-30-2020, 05:56 PM
Last Post: maiya
  Taking a CSV output and using it for another function Gduffley 1 612 Jan-30-2020, 12:13 AM
Last Post: micseydel
  Custom function that prints function text gyaan_anveyshak 3 930 Jan-28-2020, 05:43 AM
Last Post: perfringo
  Visual Studio Code does not print desired output but only prints "..." vincentolivers 11 3,868 Sep-09-2019, 12:58 PM
Last Post: vincentolivers

Forum Jump:

User Panel Messages

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