The Python summit is coming to answer questions !, Python Q &

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.