GoConqr has a new look! Let us know what you think.

Quiz

Python I

Vit C 160 questions

Take the quiz

This quiz has a time limit, so it opens in the usual player.

Questions in this quiz (160)

  1. 1Question 1
    What is the output of the following code if spam.py is run?

    # spam.py
    print("spam", end=' ')
    import ham

    # ham.py
    import eggs
    print("ham", end=' ')

    # eggs.py
    print("eggs", end=' '
    1. ASyntax Error
    2. Bspam eggs ham
    3. Cspam ham
    4. Deggs ham spam
    5. Espam ham eggs
  2. 2Frage 1
    What will be the value of the i variable when the while loop finishes its execution?
    i = 0
    while i != 0:
    i = i - 1
    else:
    i = i + 1
    1. A1
    2. B0
    3. C2
    4. Dthe variable becomes unavailable
  3. 3 Frage 41
    Which of the following words can be used as a variable name? (Choose two.)
    1. Afor
    2. BTrue
    3. Ctrue
    4. DFor
  4. 4Question 2
    How do you call the function ham() saved as spam.py below?

    def ham():
    print("Hello World")
    1. Aimport spam
      ham()
    2. Bimport spam.ham
      ham()
    3. Cimport spam
      spam.ham()
    4. Dfrom spam import ham
      ham()
    5. Eimport ham from spam
      ham()
  5. 5Frage 2
    Operator able to perform bitwise shifts is coded as (Choose two.)
    1. A--
    2. B++
    3. C<<
    4. D>>
  6. 6 Frage 42
    Python strings can be `glued` together using the operator:
    1. A.
    2. B&
    3. C_
    4. D+
  7. 7QUESTION 8
    What is the output of the following code?

    math.ceil(-1.1)
    1. A-1
    2. B-1.0
    3. C-2
    4. D-2.0
  8. 8Frage 3
    What will the value of the i variable be when the following loop finishes its execution?

    for i in range(10):
    pass
    1. A10
    2. Bthe variable becomes unavailable
    3. C11
    4. D9
  9. 9 Frage 43
    A keyword (Choose two.)
    1. Acan be used as an identifier
    2. Bis defined by Python's lexis
    3. Cis also known as a reserved word
    4. Dcannot be used in the user's code
  10. 10QUESTION 9
    What is the output of the following code?

    math.floor(-1.1)
    1. A-1
    2. B-1.0
    3. C-2
    4. D-2.0

Information

Description
Quiz on Python I, created by Vit C on 09/09/2024.
Author
Vit C
Language
English
Views
193
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?