Loop problem in python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Loop problem in python

t=1 while 't'<='5' print('t') t='t'+5 print('Finished') when I run this code nothing appears, only the word Finished appears. I tried ading nd removing quotation marks, but nothing happens. It's just ignoring the whole part and only takin the last one. what the helling prob is with this code. please hlp!!!!

2nd Dec 2016, 8:58 AM
Abdullah Omar Nasseef
Abdullah Omar Nasseef - avatar
1 Answer
+ 1
If you put a quotation mark l, it is considered as character or string. Therefore 't' is not referring to the variable that you have stated above t=1. same with the '5'.
2nd Dec 2016, 9:06 AM
최원준
최원준 - avatar