程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

day2_ Python Programming ⼊ gate operation

編輯:Python

day2 Python Programming ⼊ Enter into ⻔ Door operation

choice question

  1. Which of the following statements is in Python It's illegal ?(B)
    A. x = y = z = 1
    B. x = (y = z + 1)
    C. x, y = y, x
    D. x = y
  2. About Python Variable , The following statements are wrong (C)
    A. Variables don't need to be typed
    B. Variables can be reassigned
    C. Variable ⽆ You must first create and assign ⽽ Direct use ⽤
    D. The same variable can hold different types of values
  3. Next ⾯ Which is not Python Legal identifier (B)
    A. int64
    B. 40XL
    C. self
    D. stu_name
  4. The following about Python language ⾔ It's wrong to say (C)
    A. Python It's interpreted language
    B. Python yes ⾯ Speak to the object ⾔
    C. Python2.x and Python3.x Is fully compatible
    D. ordinary ⽂ This editor can also write Python Program
  5. The following about print Function usage is wrong (D)
    A. print(100)
    B. print(100, 200)
    C. print(100, ‘hello world!’)
    D. print(10 20)

Completion

  1. Python The symbol for a single line note in is ( # ), many ⾏ The symbol of the note is ( ‘’’ ‘’’ and “”" “”" ).
  2. sentence a, b=10,20 Of board ⾏ after ,a The value of is ( 10 ); sentence a, a = 10, 20 Of board ⾏ after ,a The value of is ( 20 ).
  3. Python The program file extension is ( .py ).
  4. stay Python in ,int The data type represented is ( integer ).
  5. stay Python in , String data needs ⽤( " " ) or ( ’ ’ ) The parcel .
  6. stay Python in , Boolean types have ( 2 ) It's worth , Namely ( True and False ).
  7. If you want to see ⼀ The data type of a data or variable , It can be used ( Type() ) function .

Programming questions

  1. Write program tips ⽤ User input ⽤ Account name and password , And will lose ⼊ The contents of are saved to different variables .
name = input(" Please enter a user name :")
password = input(" Please input a password :")
print(name)
print(password)
  1. send ⽤ One print Output 3 Data ,3 There's data in ⼀ Row display , And use the equal sign (=) separate .
a = 15
b = 30
c = 6
print(a, b, c, sep="=")

Short answer

  1. When declaring variables , What are the precautions for variable names ?

    1. Do not use the system function name 、 Class name and module name
    2. The condition of the identifier must be met , But you can't use reserved words
    3. Try to see the text and understand the meaning , It can let others understand what data the variable stores
  2. Please write out Python What are the advantages of language .

    1. The code is concise , Understandability
    2. There are many modules
    3. Strong expandability
    4. Open source 、 free
  3. Please write out Python often ⻅ Application fields of .

    1. Artificial intelligence
    2. Data analysis
    3. web Development
    4. Automated testing and automated operations
  4. Write down the questions you have about today's lecture ( Or knowledge points that feel difficult ).

    nothing


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved