Python Forum

Full Version: python prints none in function output
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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 [attachment=1168][attachment=1167]
p.s pls dont bully my story writing abilities im doing my best !!
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')
(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
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.