How does it works? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
- 1

How does it works?

no=int(input()) Sum=0 for n in range(no+1): Sum+=n print(Sum)

29th Mar 2022, 3:53 PM
Байгелди Мусаев
Байгелди Мусаев - avatar
1 Réponse
+ 2
What exactly do you mean? Which part is unclear to you? The loop sums up all numbers from 0 to no and prints the result.
29th Mar 2022, 4:17 PM
Lisa
Lisa - avatar