您好,登錄后才能下訂單哦!
自我學習記錄:如有問題,請幫助指正,勿噴。
print(1+2+3+4)
names=('Sam','Max','Leo')
for name in names:
print(name)
sum = 0
for x in (1,2,3,4,5,6,7,8,9,10):
sum =sum + x
print(sum)
print(list(range(100)))
sum = 0
n = 99
while n > 0:
sum = sum +n
n = n - 2
print(sum)
sum = 0
n = 99
while n > 0:
break
sum = sum +n
n = n - 2
print(sum,'break 跳出當前循環')
sum = 2
n = 99
s = 100
while n > 0:
sum = sum +n
n = n - 2
continue
s = 0
print('%d %d %d'%(sum,s,n))
n = 0
sum = 0
res = 0
while (n <=50):
res = (res+ n )
n = n + 1
print(res)
n=60
while (n<=100):
sum = (sum + n)
n = n + 1
sum=sum+res
print(sum)
n = 0
sum =0
res = 0
while n<=100:
sum = (sum +n)
n = n + 1
print(sum)
print(n)
n = 51
while n >50 and n <60:
res = (res + n)
n = n + 1
print(res)
print(sum - res)
n=0
sum=0
res=0
while n<=100:
if n <= 50:
res=(res + n)
n=n+1
elif (n>50 and n<60) :
n=n+1
continue
else :
sum=sum+n
n=n+1
print(res)
print(sum+res)
**
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。