日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

初识python代码

發布時間:2024/10/12 python 23 豆豆
生活随笔 收集整理的這篇文章主要介紹了 初识python代码 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1、初識代碼

1 x = 3 2 y = 4 3 z = 3*4 4 5 print("x乘以y=", z) 6 7 print("z=", z)

2、Hello,World!

1 C:\Users\Administrator\Desktop\python>python 2 Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD6 3 4)] on win32 4 Type "help", "copyright", "credits" or "license" for more information. 5 >>> print("Hello,World!") 6 Hello,World!

3、Windows測試中文顯示(python2.x需要指定中文編碼:utf-8);python3.x編碼更新為Unicode,默認向下兼容所有編碼

1 #!-*- coding:utf-8 -*- 2 3 print ("我肚子餓了,想吃飯!")

4、if.....else語句初識

(猜年齡)

1 age_of_princal = 45 2 guess_age = int(input(">>:")) 3 4 if guess_age == age_of_princal: 5 print("Yes,you got it..") 6 else: 7 print("No,it's wrong!")

判定成績

1 score = int(input("score:")) 2 3 if score > 90: 4 print("A") 5 elif score >80: 6 print("B") 7 elif score >70: 8 print("C") 9 elif score > 50: 10 print("D") 11 else: 12 print("你掛科啦")

?

轉載于:https://www.cnblogs.com/larryzhou/p/9260195.html

總結

以上是生活随笔為你收集整理的初识python代码的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。