Multiple choice test on Python - Part 11
- Question 1: What is the variable declared outside the function?
- Global variable (Global)
- Local variable (Local)
- Static variable (Static)
- Automatic variable (Automatic)
-
- Question 2: What is the variable declared inside a function called?
- Global variable (Global)
- Local variable (Local)
- Automatic variable (Automatic)
- Volatile variable
-
- Question 3: What is the output of the program below?
i=0
def change(i):
i=i+1
return i
change(1)
print(i)
- first
- 0
- Do not show results
- An exception occurs
-
- Question 4: What is the output of the program below?
def a(b):
b = b + [5]
c = [1, 2, 3, 4]
a(c)
print(len(c))
- 4
- 5
- first
- An exception occurs
-
- Question 5: What is the output of the program below?
a=10
b=20
def change():
global b
a=45
b=56
change()
print(a)
print(b)
- ten
56 - 45
56 - ten
20 - Syntax Error
-
- Question 6: What is the output of the program below?
def change(i = 1, j = 2):
i = i + j
j = j + 1
print(i, j)
change(j = 1, i = 2)
- An exception occurs
- twelfth
- 3 3
- 3 2
-
- Question 7: What is the output of the program below?
def change(one, *two):
print(type(two))
change(1,2,3,4)
- Integer
- Tuple
- Dictionary
- List
-
- Question 8: What is the output of the program below?
def display(b, n):
while n > 0:
print(b,end="")
n=n-1
display('z',3)
- zzz
- zz
- An exception occurs
- An infinite loop
-
- Question 9: What is the output of the program below?
def find(a, **b):
print(type(b))
find('letters',A='1',B='2')
- String
- Tuple
- Dictionary
- List
-
- Question 10: What is the output of the program below?
x = 2
def vidu():
global x
y = "Biến cục bộ"
x = x * 2
print(x)
print(y)
vidu()
- 4
Local variable -
Local variable
4
- 2
Local variable - Exception
-
5 ★ | 1 Vote
You should read it
- Multiple choice quiz about Python - Part 1
- Multiple choice quiz about Python - Part 2
- Multiple choice quiz about Python - Part 4
- Multiple choice quiz about Python - Part 10
- Multiple choice quiz about Python - Part 5
- Multiple choice quiz about Python - Part 6
- Multiple choice quiz about Python - Part 9
- Multiple choice quiz about Python - Part 8
May be interested
- eQuiz - VB.NET testing test - Part 2in the previous article, i showed you the first part of the vb.net test. and this time, we will continue with part 2 of this popular quiz series on programming languages, the whole test will have 15 questions with unlimited response time.
- Test on JAVA test P7a set of multiple-choice questions about java gives you useful knowledge for work and study. the set of questions below includes 10 sentences for you to experience.
- JAVA test on P4the multiple choice questions about java programming will provide you with useful knowledge in the process you apply to learning as well as working with java. invite your reference.
- JAVA test on P6multiple choice questions about java programming give you useful knowledge. if you love java programming, don't skip the series of interesting tests below by network administrator.
- Test of technology terminology - Part 9let's continue with tipsmake.com to learn the 9th term of technology terms! don't miss out on the interesting multiple-choice section again!
- JAVA test test P1java is an object-oriented and class-based programming language. to help you read more interesting knowledge about the java programming language, the network administrator will send you a very interesting multiple choice question on this topic. please try.
- eQuiz - Multiple choice test on JDBC - Part 1in the quiz below, we will introduce you to part 1 of the jdbc basic knowledge test series with 15 questions.
- LAN test with answer - Part 2the lan question set has the answer.
- Test on JAVA P10 testmultiple choice questions on java programming help you test your basic knowledge of this programming language. the set of questions includes 10 sentences to try.
- eQuiz - Multiple choice test on PHP Practice - part 1in the quiz below, we will introduce you to part 1 of the test series of basic knowledge about php practive with 15 questions.