0
1.Number=int(input("enter number")) 2.sum=0 3.for I in range(1, number+1) 4.sum=sum+1 5.print(sum)
What this full program mean pls tell me
3 ответов
0
https://code.sololearn.com/c4dsRNMMEQjk/?ref=app
Keep looking at
number=int(input("enter number"))
sum=0
for I in range(1, number+1):
sum=sum+1
print(sum)
every two seconds so you understand what I'm saying
0
Ty
0
This looks a bit complicated, let's fix it:
#enter a number
num = int(input('enter number '))
# sum is 0
sum = 0
# now let us find what is this:
for l in range(1,num+1):
# so for l in this range ↑
sum = sum+1 # sum+=1
# we will add 1 to sum, it is just counting !
print(sum)
# so for this there is a pretty solution:
print(*range(1,int(input('enter number '))+1))