Multiple choice test on Python - Part 11

  1. Question 1: What is the variable declared outside the function?
    1. Global variable (Global)
    2. Local variable (Local)
    3. Static variable (Static)
    4. Automatic variable (Automatic)
  2. Question 2: What is the variable declared inside a function called?
    1. Global variable (Global)
    2. Local variable (Local)
    3. Automatic variable (Automatic)
    4. Volatile variable
  3. Question 3: What is the output of the program below?
     i=0 
    def change(i):
    i=i+1
    return i
    change(1)
    print(i)
    1. first
    2. 0
    3. Do not show results
    4. An exception occurs
  4. 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))
    1. 4
    2. 5
    3. first
    4. An exception occurs
  5. 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)
    1. ten
      56
    2. 45
      56
    3. ten
      20
    4. Syntax Error
  6. 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)
    1. An exception occurs
    2. twelfth
    3. 3 3
    4. 3 2
  7. Question 7: What is the output of the program below?
     def change(one, *two): 
    print(type(two))
    change(1,2,3,4)
    1. Integer
    2. Tuple
    3. Dictionary
    4. List
  8. 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)
    1. zzz
    2. zz
    3. An exception occurs
    4. An infinite loop
  9. Question 9: What is the output of the program below?
     def find(a, **b): 
    print(type(b))
    find('letters',A='1',B='2')
    1. String
    2. Tuple
    3. Dictionary
    4. List
  10. 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()
    1. 4
      Local variable
    2. Local variable

      4

    3. 2
      Local variable
    4. Exception
5 ★ | 1 Vote

May be interested

  • eQuiz - VB.NET testing test - Part 2eQuiz - VB.NET testing test - Part 2
    in 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 P7Test on JAVA test P7
    a 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 P4JAVA test on P4
    the 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 P6JAVA test on P6
    multiple 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 9Test of technology terminology - Part 9
    let'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 test test P1
    java 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 1eQuiz - Multiple choice test on JDBC - Part 1
    in 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 2LAN test with answer - Part 2
    the lan question set has the answer.
  • Test on JAVA P10 testTest on JAVA P10 test
    multiple 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 1eQuiz - Multiple choice test on PHP Practice - part 1
    in the quiz below, we will introduce you to part 1 of the test series of basic knowledge about php practive with 15 questions.