0

what is wrong whit this code?

idential block error in line 3 x=input() if x<5: print("less than 5") if 5=<x<=10: print("betwen 5 and 10") if x>10: print("more than 10)

30th Jan 2021, 12:14 AM
AmirhosseinYazdani
AmirhosseinYazdani - avatar
6 ответов
+ 1
hi Amirhusein try this... https://code.sololearn.com/cVcRSOzEA3ur/?ref=app the error is caused by a lack of indention, additionally “=<“ should be “<=“, thirdly you need to close the quotation mark in the final line
30th Jan 2021, 12:33 AM
Ollie Q
Ollie Q - avatar
+ 1
Define the input as an integer (int), than change =< and everything alike to <=. The last statement lacks a quote. And have an eye on the indentation they are not visible in this post
30th Jan 2021, 12:19 AM
StephBill
StephBill - avatar
+ 1
i changed these things you said but still show me error in same line 3.
30th Jan 2021, 12:26 AM
AmirhosseinYazdani
AmirhosseinYazdani - avatar
+ 1
print after "if... :" needs to be indented so adding 4 spaces (in some IDEs) might help
30th Jan 2021, 12:31 AM
StephBill
StephBill - avatar
+ 1
i do not understand your code was similar to mine but worked i apperciate it thanks.
30th Jan 2021, 12:41 AM
AmirhosseinYazdani
AmirhosseinYazdani - avatar