The Python summit is coming to answer questions !, Python Q &
People around me don't even play "jump". They are all fascinated by a theme called "Summit Meeting" and have learned a lot of cold knowledge from various disciplines, literature, mathematics, geography, biology, animation, gossip... I have found some questions about python on Alibaba Cloud.
1. The output result of the following expression is:
x = 12def f1(): x = 3 print(x)def f2(): x += 1 print(x)f1()f2()
A) 3 4
B) 3 13
C) 12 13
D) 3. Error
2. What are the output content of the following two expressions?
>>> a = 1>>> b = 1>>> a is b???>>> a = 300>>> b = 300>>> a is b???
A) True
B) True False
C) False
D) False True
3. What is the value of expression 3*1 ** 3?
A) 27
B) 9
C) 3
D) 1
4. What is the return value of the function below?
def func(a): a = a + '2' a = a*2 return a>>>func("hello")
A) hello
B) The string does not support * operations
C) hello2
D) hello2hello2
5. In Python, what is the return value of the expression 0.1 + 0.2 = 0.3?
A) True
B) False
C) Uncertainty
6. Expression ~~~ What is the value of 5?
A) + 5
B)-6
C) + 6
D)-5
7. the return value of the expression bool ('false') is:
A) True
B) False
C) 0
D) 1
8. the return value of the expression True = False is:
A) True
B) False
C) 0
D) 1
9. The output result of the following expression is:
i = 0while i < 5: print(i) i += 1 if i == 3: breakelse: print(0)
A) 0 1 2 0
B) 0 1 2
C) 0 1
D) 0 1 2 3
10. Which of the following words is not the keyword in Python3?
A) eval
B) assert
C) nonlocal
D) pass
Check the correct answers.