0
Why isn't 'x' acting as a variable here?
I did this in code playground -- x= int(input()) if x > 5 print("x is greater than 5) print("program ended") Here, the 'x' in the print function (after the indentation I mean) is not acting as a variable... It does not take the value I give it. If I give x a value of 6, the output comes as -- x is greater than 5 program ended I want the out put as -- 6 is greater than 5 program ended How can I do it?
1 Resposta
+ 1
You do not state what the language is but I expect you need to put something like
print(x + " is greater than 5.")
hope this helps.