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

歡迎訪問 生活随笔!

生活随笔

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

python

循序渐进学Python2变量与输入

發布時間:2023/12/20 python 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 循序渐进学Python2变量与输入 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

新建一個test.py文件,右鍵選擇“Edit with IDLE”,編輯完成后,Ctrl+S保存,然后按下F5就可以執行代碼了。

注:IDLE是Python官方提供的一個IDE工具。

目錄

?[隱藏]?
  • 1?注釋
  • 2?數字
  • 3?變量
  • 4?輸入用法

[編輯]注釋

#This is a commentprint"This will run."#comment


多行注釋使用三個單引號(''')或三個雙引號(""")。

[編輯]數字

print 25 + 30 / 6print"Is it true that 3+2 < 5-7?"print 3+2<5-7

輸出:

30 Is it true that 3+2<5-7? False

[編輯]變量

cars =100print"There are", cars,"cars available."

輸出:

There are 100 cars available. my_name ="Lei Jun" your_name ="Jobs"print"Let's talk about", my_name print"Let's talk about?%s and?%s."?% (my_name, your_name)

輸出:

Let's talk about Lei Jun Let's talk about Lei Jun and Jobs.

[編輯]輸入用法

print"How old are you?" age =raw_input()print"You're?%s old."% age

輸出:

How old are you? 27 You're 27 old.

age =raw_input("How old are you?")print"You're?%s old."% age

輸出:

How old are you?38 You're 38 old.

轉載于:https://www.cnblogs.com/elesos/p/6738322.html

總結

以上是生活随笔為你收集整理的循序渐进学Python2变量与输入的全部內容,希望文章能夠幫你解決所遇到的問題。

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