Quiz Space

Python week 4 important questions

Week 4 of Programming in Python: Iterations & ranges. Extra important questions based on the recent, changing patterns of the exams, from basic to advanced. Practise them in learning mode: each question has a worked solution.

Question 1

One correct option

What is printed by the following program?

print(list(range(0, 11, 2)))
  1. A

    Error

  2. B

    [0, 2, 4, 6, 8, 10]

  3. C

    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

  4. D

    [1, 3, 5, 7, 9]

Question 2

One correct option

What will be the output of the code below?

print(len(range(6, 13, 3)))
  1. A

    4

  2. B

    0

  3. C

    3

  4. D

    7

Question 3

Numerical answer

Consider the program given below. What does it print?

print(sum(range(1, 11, 5)))

More questions in this week

Authorise with Google to see every question with its answer and explanation and practise it in learning mode.