I don't understand what is the error in this project help me?? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

I don't understand what is the error in this project help me??

https://code.sololearn.com/clEC84VTeu5k/?ref=app

19th Oct 2019, 11:14 PM
Badredestro
13 Respostas
+ 2
Pay attention to indentation Correct code is x = 6 if x == 8: print("X is 8") else: if x == 7: print("X is 7") else: if x == 10: print("X is 10") else : print("X is not 8 and 7 and 10")
21st Oct 2019, 11:54 AM
Programmer Raja
Programmer Raja - avatar
+ 6
Always pay attention to identation, here is how to properly ident your code, and more tips, by HonFu: https://code.sololearn.com/c9a0cG9dpVUr/?ref=app
19th Oct 2019, 11:17 PM
Aymane Boukrouh
Aymane Boukrouh - avatar
+ 5
Aymane Boukrouh, thanks for showing that one! I have another one, maybe better for the beginning (just read it, don't run): EDIT: What is this? I can't link codes! New bug? Going over a side track now: https://code.sololearn.com/cT5BRIbkia21/?ref=app
19th Oct 2019, 11:35 PM
HonFu
HonFu - avatar
+ 2
Don't worry only indentation is the problem
21st Oct 2019, 1:30 PM
Swastik Vaish
Swastik Vaish - avatar
+ 1
Thanks honfu
20th Oct 2019, 11:17 AM
Badredestro
+ 1
I was really confused about this rules
20th Oct 2019, 11:18 AM
Badredestro
+ 1
Don't worry, itwill become second nature to you if you practice for a while.
20th Oct 2019, 11:26 AM
HonFu
HonFu - avatar
20th Oct 2019, 11:41 AM
Badredestro
+ 1
I understand now
20th Oct 2019, 11:42 AM
Badredestro
+ 1
In python you also have 'elif'. Then you don't need to wander a step to the right each time. That would look like this: x = 6 if x == 5 : print("X is five") elif x == 4 : print("X is four") elif x == 7 : print("X is seven") else: print("X is not five,four and seven")
20th Oct 2019, 11:51 AM
HonFu
HonFu - avatar
+ 1
Oh. I just learn this Elif is a short word of "else if"
20th Oct 2019, 11:52 AM
Badredestro
+ 1
Yeah thanks
20th Oct 2019, 11:52 AM
Badredestro
+ 1
You need to indent it
21st Oct 2019, 9:23 PM
Eric Craker
Eric Craker - avatar