2 ответов
+ 4
Hi Aphiwe Ayanda , here is the short, pythonic as well as an efficient way:
for i in range(Maxx):
print("hi")
- For loops in python is very useful and its a much pythonic way rather than while loops
- For loops in python has a different syntax rather than langs like c++ and js has!
- Using for loops with python range() can be said as an intelligent feature, ie, will auto-increment lcv