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

Quiz

Pyton 1

_ 35 questions

Take the quiz

Questions in this quiz (35)

  1. 1What is the output of the following piece of code if the user enters two lines
    containing 3 and 2 respectively?
    1. A3
    2. B0
    3. C2
    4. D1
  2. 2What value will be assigned to the x variable?
    z = 0
    y - 10
    x - y < z and z > y or y > z and z < y
    1. A0
    2. B1
    3. CFalse
    4. DTrue
  3. 3The following snippet:
    def function_1 (a) :
    return None
    def function 2 (a) :
    return function_1 (a) + function 1 (a)
    print (function_2 (2) )
    1. Awill output 2
    2. Bwill output 16
    3. Cwill output 4
    4. Dwill cause a runtime error
  4. 4What will be the output of the following snippet?
    a=1
    b=0
    a=a^b
    b=a^b
    a=a^b
    print (a, b)
    1. A1 0
    2. B11
    3. C01
    4. D00
  5. 5What is the output of the following snippet?
    tup = (1, 2, 4, 8)
    tup - tup[-2:-1)
    tup - tup[-1]
    print (tup)
    1. A(4)
    2. B(4,)
    3. C4
    4. D44
  6. 6Take a look at the snippet and choose the true statement:
    nums = [1, 2, 3]
    vals - numa
    del vals [:]
    1. Anums is longer than vals
    2. Bthe snippet will cause a runtime error
    3. Cnums and vals have the same length
    4. Dvals is longer than nums
  7. 7What is the output of the following snippet?
    det - {'one ': 'two', 'three': 'one', 'two': 'three')
    v - del['three']
    for k in range (len (det)) :
    v - dct [v]
    print (v)
    1. Athree
    2. Bone
    3. Ctwo
    4. D('one','two','three')
  8. 8What is the output of the following snippet?
    my_list - (1, 21
    for v in range (2) :
    my_list.insert (-1, my list [v])
    print (my 1ist)
    1. A[1, 2, 1, 2]
    2. B[2, 1, 1, 2]
    3. C[1, 1, 1, 2]
    4. D[1, 2, 2, 21
  9. 9What is the output of the following piece of code if the user enters two lines
    containing 2 and 4 respectively?

    x = float (input ())
    y = float (input ())
    print (y * (1/ x))
    1. A1.0
    2. B2.0
    3. C0.0
    4. D4.0
  10. 10The following snippet:
    def func (a, b):
    relurn b
    print (func (b-2, 2)
    1. Awill output None
    2. Bwill output 4
    3. Cwill output 2
    4. Dis erroneous

Information

Description
Quiz on Pyton 1, created by _ _ on 21/01/2022.
Author
_ _
Language
English
Views
13
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?