what is wrong whit this code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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 Answers
+ 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
+ 2
1. Indentation error. (There are a lot of them). To put indentation you can use four spaces 2. In the 4th line, put <= instead of =< 3. In the 7th line put a " at the end of the string I hope this helps Amirhusein . Happy coding
30th Jan 2021, 5:07 AM
∆BH∆Y
∆BH∆Y - 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