Ch 27 sum number with while loop
total = 0
i=1
while i<=10:
total=total+i
i=i+1
print(total)
# I mistake print("total") I not put the "" because the print value is int not string
i=0
while i<=45:
print(i)
i=i+1
#the i is impo to increase the value repeat
#If you use the while u must assign the variable first and increase the variable values at the last
#you also use () to the conditions
Comments
Post a Comment