All Exams  >   Class 9  >   Cyber Olympiad for Class 9  >   All Questions

All questions of Introduction to Python 3.11 for Class 9 Exam

What will be the output of the following Python code?
  • a)
    3.5, 3, 1, 49
  • b)
    3.5, 3, 1, 128
  • c)
    3.5, 3, 1, 64
  • d)
    3.5, 3, 1, 32
Correct answer is option 'A'. Can you explain this answer?

Imk Pathshala answered
The first `print (x / y)` outputs `3.5`.
The second `print(x // y)` outputs `3` (integer division).
The third `print(x % y)` outputs `1` (remainder).
The fourth `print(y ** x)` outputs `49` (power calculation).

What does the following Python code print?
  • a)
    1 2
  • b)
    2 4
  • c)
    2 3
  • d)
    1 3
Correct answer is option 'B'. Can you explain this answer?

Let's Tute answered
The loop iterates through numbers from '1' to '4'. It prints even numbers ('2' and '4') due to the 'if i % 2 == 0' condition.

What is the output of the following Python code?
  • a)
    1, 7, 6
  • b)
    2, 8, 7
  • c)
    1, 8, 7
  • d)
    2, 7, 6
Correct answer is option 'C'. Can you explain this answer?

Let's Tute answered
  • `x & y` performs bitwise AND (`0101 & 0011`), resulting in `0001` which is `1`.
  • `x | y` performs bitwise OR (`0101 | 0011`), resulting in `1000` which is `8`.
  • `x ^ y` performs bitwise XOR (`0101 ^ 0011`), resulting in `0110` which is `6`.

What will be the output of the following Python code?
  • a)
    2.5
  • b)
    2, 2, 1, 25
  • c)
    2, 2, 1, 32
  • d)
    2, 2, 0, 25
Correct answer is option 'C'. Can you explain this answer?

EduRev Class 9 answered
  • The first 'print(x / y)' outputs '2.5'.
  • The second 'print(x // y)' outputs '2' (integer division).
  • The third 'print(x % y)' outputs '1' (remainder).
  • The fourth 'print(y ** x)' outputs '32' (power calculation).

What is the output of the following Python code?
  • a)
    2, 7, 8
  • b)
    1, 8, 7
  • c)
    2, 7, 5
  • d)
    1, 8, 6
Correct answer is option 'C'. Can you explain this answer?

Imk Pathshala answered
  • `x & y` performs bitwise AND (`0110 & 0011`), resulting in `0010` which is `2`.
  • `x | y` performs bitwise OR (`0110 | 0011`), resulting in `0111` which is `7`.
  • `x ^ y` performs bitwise XOR (`0110 ^ 0011`), resulting in `0101` which is `5`.

What does the following Python code print?
  • a)
    1 2 3 4 5
  • b)
    1 3 5
  • c)
    2 4 6
  • d)
    1 3
Correct answer is option 'B'. Can you explain this answer?

EduRev Class 9 answered
The `range(1, 6, 2)` generates numbers `1, 3, 5`. The loop prints these numbers with a space in between.

Chapter doubts & questions for Introduction to Python 3.11 - Cyber Olympiad for Class 9 2026 is part of Class 9 exam preparation. The chapters have been prepared according to the Class 9 exam syllabus. The Chapter doubts & questions, notes, tests & MCQs are made for Class 9 2026 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests here.

Chapter doubts & questions of Introduction to Python 3.11 - Cyber Olympiad for Class 9 in English & Hindi are available as part of Class 9 exam. Download more important topics, notes, lectures and mock test series for Class 9 Exam by signing up for free.

Top Courses Class 9