Latest code is not generating console output--any insights?

Question:
When I hit ‘run’ the out is giving me in the console is the result of x only.
I want the console to return me a result of x, w, and h

please note i am very new to python like less than a week,

Repl link:

 x=input("hello world")
print(x)

w = int(input(53))
h = float(input(5.2))
x=input("hello world")
print(x)

w = int(input(53))
h=float(input(5.2))
print(w, h)

Hey @jmd5991!

In python, input expects input from the user, not your code (which is the opposite of what you want), could you try just removing the input wrapper around your variables?

EX:

abc = "example" 
print(abc)
# instead of
abc = input("example")
print(abc)

If you run the two codes, you’ll see that the first example runs, prints once, and finishes. Meanwhile, the second one prints “example”, and then won’t stop running until you provide input, and then it’ll print what you gave it on another line.

3 Likes

Hello @Firepup650 thank you so much for clarify. I am able to fix my simple code and get the results on the next lines, :grinning:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.