Need some help in this while concept | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Need some help in this while concept

To find nth Fibonacci number https://code.sololearn.com/cgfL7OotrNI1/?ref=app

3rd Aug 2021, 2:06 PM
Raj
2 Answers
+ 5
Hi Raj! Your concept is okay. But, the thing is you have to indent every time you use a loop or decision statement such as: for, while or if. Because python is very sensitive about indenting. Also, it is a case sensitive language means s(lower) and S are different things. And there are some small mistakes found. Here it is your working code. https://code.sololearn.com/cdlky2vJh1hi/?ref=app
3rd Aug 2021, 2:27 PM
Python Learner
Python Learner - avatar
+ 2
Adding to JUMP_LINK__&&__Python__&&__JUMP_LINK Learner You should write according to PEP8, you should write 4 spaces inside different structures, and using spaces in statements, watch this code for illustration https://code.sololearn.com/cWpg8ap1bP4u/?ref=app
3rd Aug 2021, 2:41 PM
Roma Butaku
Roma Butaku - avatar