python - print statement inside of input returns with a "none" -



python - print statement inside of input returns with a "none" -

i working on little programme , want use:

ans = int(input(print(multi,'x',num,'=')))

this works except fact after prints print statement says none. like:

49 x 7 = none

how on remove "none" if possible? did search problem nil returning none within of input.

input takes prompt string argument, print automatically, print returns none; gets printed input. code equivalent to:

prompt = print(...) # prompt == none ans = int(input(prompt))

instead, utilize str.format build prompt , pass straight input:

ans = int(input('{0}x{1}='.format(multi, num)))

python input

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -