欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

Python示例程序

系統 1636 0

Recursive articles(遞歸篇)

Feibo sequence

            
              def fib(number):
    if number==0 or number == 1:
        return number

    else:
        return fib(number-1) + fib(number-2)

for i in range(8):
    print("fib(%2d) = %2d" % (i,fib(i)))
            
          

We can control the time of the function.

            
              def fib(number):
    if number==0 or number == 1:
        return number

    else:
        return fib(number-1) + fib(number-2)
while True:
    a = int(input("How many do you want?"
                  "\nThis integer must be > 0"
                  "Please enter your integer:"))
    if a < 0:
        print("The integer of you enter is wrong,please enter again!\n")
        continue
    for i in range(a+1):
        print("fib(%d) = %2d" % (i,fib(i)))
    print()
            
          

List's using methods.

            
              # creating an empty list
list = []

# add new value to the list
for number in range(1,11):
    list += [ number ]

print(list)
print()
# len(list) is the method to get the length of the list
print("There are",len(list),"elements in the list")
print()

# print the values in list
i = 0
for item in list:

    print("list[%d] is %d"%(i,item))
    i += 1
print()

# change the value in list
list[0] = 100
# if the index lower than 0
# it will Count from the right
# this is a logical error that is not serious
# better never use it!!!!!
list[-3] = 999
print(list)
            
          

Dictionary

            
              # creating empty dictionary
empty_dictionary={"name":"No"}

# creating another dictionary
grade={"name":"Sabo",
       "grade":"Good!",
       }

# output the grade
print("grade dictionary is")
print(grade)
print()

# add to our empty dictionary
print("before add grade")
print("empty_dictionary is ")
print(empty_dictionary)
print()

print("after add grade")
print("empty_dictionary is ")
empty_dictionary.update(grade)
print(empty_dictionary)
            
          

?


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦?。?!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 成人精品鲁一区一区二区 | 欧美日韩国产综合网 | 国产成人精品免费午夜 | 久久3| 91精品啪国产在线观看免费牛牛 | 国产精品高清视亚洲乱码 | 日韩在线精品视频 | 国产在线精品一区二区三区 | 国产精品久久久久久一级毛片 | 日本色婷婷| 日韩一区二区三区精品 | 午夜视频在线观看视频 | 久久综合丝袜长腿丝袜 | 九九精品激情在线视频 | 国产精品视频 | 艹逼视频免费 | 2021中文字幕亚洲精品 | 久久中文网 | 国产成人精品福利站 | 99视频这里只有精品国产 | 狠狠色丁香婷婷综合橹不卡 | 中文字幕av一区二区三区 | 91av爱爱 | 天天天天 | 日韩精品亚洲一级在线观看 | 日韩av一区二区三区在线 | 欧美亚洲国产另类在线观看 | 久久久国产一区二区三区 | 久久综合色婷婷 | 麻豆md国产在线观看 | 国产成人18黄禁网站免费观看 | 日韩一区二区中文字幕 | 九九国产| 欧美xxxx性xxxxx高清 | 日一区二区 | 精产国产伦理一二三区 | 亚洲在线偷拍自拍 | 国产亚洲蜜芽精品久久 | 在线播放一区二区三区 | 国产羞羞视频免费在线观看 | 国产精品美女久久久 |