What is wrong with this? logic section 9-13


#1

x = 1
if x > 5:
print "Big"
else:
print “small”

#like it works for the previous case when it asks me to set x=10 but when it wants a number less that will print out small it never works…


#2

In your code (which is missing indentation and is therefore not valid python code) x has been set to 1 which is indeed not greater than 5 and therefore “small” gets printed

Perhaps a better piece of code to show would be one that you expected to print “Big”?


#3

oh yeah i forgot to add in the indents. the issue is the lesson asks me to put in an x value that prints small . when you put in one it does print small but the website says oops try again


#4

Yeah okay. That makes more sense.
I still don’t know which exercise it is. You say 9-13 but I don’t know how to interpret that. Perhaps you mean the 9th exercise out of 13, but then one would need to find all groups of 13 exercises and check the 9th ones to figure out which it is. A link to the exercise is much less of a puzzle.


#5

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