r/learnpython • u/21bce • Jul 31 '22
Loops in python are weird
I recently started learning python programming. I also had some exposure to programming in my high school.
Today I studied loops but I found them a little bit weird...they do not have any initialisation, condition and increment like other languages like javascript.
It is very confusing to me PLEASE HELP!!
0
Upvotes
16
u/Green-Sympathy-4177 Jul 31 '22
Actually you can get the same result:
js:
python:
I would say that javascript is weird, why is it that to iterate over an array you have to do this in js:
Python: