0
Strange input problem!
If I try the input "print("any string")" , the output comes out something like this: any string You entered: print("any string") result: None # why does this happen? # here is the code: https://code.sololearn.com/cEcsy8P3yurY/?ref=app
5 Answers
+ 3
eval converts strings into executable Python code.
print is a function that returns None, because it's return wouldn't have big value.
print(print("any string"))
would print:
any string
None
Because print("any string") evaluates to None
+ 1
Oh, I see!
Thanks Seb TheS for the brief explanation. đđđ
0
wet water ))) I think it's the magic of the function "eval() ". Please check out the code correctly. I just want the explanation of this code.
0
Why are not using input method or function it is easy or u will be not confuse by it
For example:
a=input("any string:")
Print(a)
Thank you best of luck