python 練一練 3- 7

來源:互聯網
上載者:User

標籤:輸出   style   blog   pre   隨筆   a*   ++   float   class   

輸出:  +++++++++++

     +     +

     +++++++++++

1 print("+++++++++++")2 print("+         +")3 print("+++++++++++")4 5 6 print("+"*11)7 print("+"+" " *9+"+")      # 一個加號 加上空格乘以九再加上一個加號8 print("+"*11)

小隨筆:

# 寫法1: 直接用\n換行,輸出三次
# 字串 \n 是分行符號
# 字串 \t 是縮排符號,每個縮排符號是八個空格位置


1 #  有()換行,可以直接換行2 print("想你想你想你想你想你想你"3       "想你想你想你想你想你想你想你想你")4 5 #  沒有有()換行的,換行那一行後面會有個\6 msg = "想你想你想你想你想" 7       "你想你想你想你想你想你"

 

輸入直角三角形的兩個直角三角形的長度a,b, 求斜邊c的長度。

1 a = float(input("請輸入直角a:"))2 b = float(input("請輸入直角b:"))3 4 c = (a**2 + b**2) ** 0.55 print("斜邊C:"+str(c))

 

python 練一練 3- 7

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.