- 1
[Challenge] What will be displayed if 3 is an input?.
a = input("Enter a number:") if a==3: print("hello") else: print("Good game")
8 odpowiedzi
+ 6
Oh wait, i realise a is not an integer.
Hence the output is "good game".
Nice! Make a quiz question out of this!
+ 2
@blackcat1111 I forgot to mention, this is a challenge :)
+ 2
@Pegasus Sr mate. Your answer is not correct :)
+ 2
In my opinion, the question is wrong. It never said the user inputted 3, but rather that a *is* 3, an integer. Therefore, the answer is "hello". I understand your point, but I think you should rephrase your question to be more clear. 😉
+ 2
# Outputs 'Good game'
+ 1
Why don't you try it yourself? There's Code Playground for a reason.
+ 1
It'll print "hello"