Class 9 Exam  >  Class 9 Tests  >  Olympiad Test: Introduction to Python 3.11 - 1 - Class 9 MCQ

Olympiad Test: Introduction to Python 3.11 - 1 - Class 9 MCQ


Test Description

10 Questions MCQ Test - Olympiad Test: Introduction to Python 3.11 - 1

Olympiad Test: Introduction to Python 3.11 - 1 for Class 9 2024 is part of Class 9 preparation. The Olympiad Test: Introduction to Python 3.11 - 1 questions and answers have been prepared according to the Class 9 exam syllabus.The Olympiad Test: Introduction to Python 3.11 - 1 MCQs are made for Class 9 2024 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests for Olympiad Test: Introduction to Python 3.11 - 1 below.
Solutions of Olympiad Test: Introduction to Python 3.11 - 1 questions in English are available as part of our course for Class 9 & Olympiad Test: Introduction to Python 3.11 - 1 solutions in Hindi for Class 9 course. Download more important topics, notes, lectures and mock test series for Class 9 Exam by signing up for free. Attempt Olympiad Test: Introduction to Python 3.11 - 1 | 10 questions in 15 minutes | Mock test for Class 9 preparation | Free important questions MCQ to study for Class 9 Exam | Download free PDF with solutions
Olympiad Test: Introduction to Python 3.11 - 1 - Question 1

What will be the output of the following Python code?

Detailed Solution for Olympiad Test: Introduction to Python 3.11 - 1 - Question 1
  • 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).
Olympiad Test: Introduction to Python 3.11 - 1 - Question 2

What is the output of the following Python code?

Detailed Solution for Olympiad Test: Introduction to Python 3.11 - 1 - Question 2

The condition 'x > 5' evaluates to 'True', so it prints ' "Hello, " ' followed by ' "Goodbye!" '.

1 Crore+ students have signed up on EduRev. Have you? Download the App
Olympiad Test: Introduction to Python 3.11 - 1 - Question 3

What is the output of the following Python code?

Detailed Solution for Olympiad Test: Introduction to Python 3.11 - 1 - Question 3

'nums[1:3]' extracts elements from index '1' to '2' (exclusive of index '3'), so it prints '[2, 3]'.

Olympiad Test: Introduction to Python 3.11 - 1 - Question 4

What will be the output of the following Python code?

Detailed Solution for Olympiad Test: Introduction to Python 3.11 - 1 - Question 4

The function 'greet("Alice")' prints ' "Hello, Alice!" '.

Olympiad Test: Introduction to Python 3.11 - 1 - Question 5

What does the following Python code print?

Detailed Solution for Olympiad Test: Introduction to Python 3.11 - 1 - Question 5

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

Olympiad Test: Introduction to Python 3.11 - 1 - Question 6

What will be the output of the following Python code?

Detailed Solution for Olympiad Test: Introduction to Python 3.11 - 1 - Question 6

'factorial(4)' computes '4 * 3 * 2 * 1' which equals '24'.

Olympiad Test: Introduction to Python 3.11 - 1 - Question 7

What is the output of the following Python code?

Detailed Solution for Olympiad Test: Introduction to Python 3.11 - 1 - Question 7
  • `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`.
Olympiad Test: Introduction to Python 3.11 - 1 - Question 8

What does the following Python code print?

Detailed Solution for Olympiad Test: Introduction to Python 3.11 - 1 - Question 8

`nums[::-1]` reverses the list `nums`, so it prints `[5, 4, 3, 2, 1]`.

Olympiad Test: Introduction to Python 3.11 - 1 - Question 9

What is the output of the following Python code?

Detailed Solution for Olympiad Test: Introduction to Python 3.11 - 1 - Question 9

`x ** y` calculates `5` raised to the power `2`, resulting in `25`.

Olympiad Test: Introduction to Python 3.11 - 1 - Question 10

What will be the output of the following Python code?

Detailed Solution for Olympiad Test: Introduction to Python 3.11 - 1 - Question 10

The function `greet()` returns ` "Hello, World!" ` which is then printed.

Information about Olympiad Test: Introduction to Python 3.11 - 1 Page
In this test you can find the Exam questions for Olympiad Test: Introduction to Python 3.11 - 1 solved & explained in the simplest way possible. Besides giving Questions and answers for Olympiad Test: Introduction to Python 3.11 - 1, EduRev gives you an ample number of Online tests for practice

Top Courses for Class 9

Download as PDF

Top Courses for Class 9