0% found this document useful (0 votes)
2K views3 pages

CBAANSWERKEY

The document is an answer key for the Pre MidTerm 1 Examination in Computer Science for Class XI at Uttam School for Girls. It includes objective and conceptual questions related to Python programming, covering topics such as syntax, operators, and programming tasks. Additionally, it provides programming exercises for calculating products, checking voting eligibility, determining odd/even numbers, and computing the area and circumference of a circle.

Uploaded by

shradha19711
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views3 pages

CBAANSWERKEY

The document is an answer key for the Pre MidTerm 1 Examination in Computer Science for Class XI at Uttam School for Girls. It includes objective and conceptual questions related to Python programming, covering topics such as syntax, operators, and programming tasks. Additionally, it provides programming exercises for calculating products, checking voting eligibility, determining odd/even numbers, and computing the area and circumference of a circle.

Uploaded by

shradha19711
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Uttam School for Girls

Pre MidTerm 1Examination-m Answer Key


Class –XI
Computrer Science

Section A – Objective and Conceptual Questions

1. What is the correct way to print something in Python?

 A) echo "Hello"
 B) say("Hello")
 C) print("Hello")
 D) output("Hello")

Answer: C) print("Hello")

2. What does print(5 + 3) display?

 A) Shows 53
 B) Shows 8
 C) Shows 5 + 3
 D) Error

Answer: B) Shows 8

3. Evaluate the following expression:

6 * 3 + 4 * 2 – 8

Answer: 18

4. Which statement is used to check multiple conditions in Python?

 A) if-else
 B) if-elif-else
 C) switch-case
 D) when-then

Answer: B) if-elif-else
5. Which is the correct syntax of an if statement in Python?

 A) if (a > b) {
 B) if a > b:
 C) if a > b then:
 D) if a > b then {

Answer: B) if a > b:

6. Which of these is a number in Python?

 A) "7"
 B) 7
 C) '7'
 D) "seven"

Answer: B) 7

7. Write the syntax of an if-else statement in Python.

if condition:
# code if condition is True
else:
# code if condition is False

8. Explain the difference between = and == in Python with examples.

 = assigns a value to a variable.


 == checks if two values are equal.

Example:

x = 5 # Assignment
x == 5 # Comparison → True

9. Differentiate between mathematical operators and relational operators

Mathematical Operators Relational Operators


+, -, *, / ==, !=, >, <
Used for arithmetic Used to compare values

Section B – Programming Questions


1. Write a program to enter 3 numeric values from the user and calculate their
product

a = float(input("Enter first number: "))


b = float(input("Enter second number: "))
c = float(input("Enter third number: "))
product = a * b * c
print("The product is:", product)

2. Write a program that asks the user to enter their age and checks voting
eligibility

age = int(input("Enter your age: "))

if age >= 18:


print("You are eligible to vote.")
else:
print("You are not eligible to vote.")

3. Write a program to enter a number and check if it is odd or even

num = int(input("Enter a number: "))

if num % 2 == 0:
print("The number is even.")
else:
print("The number is odd.")

4. Write a program to enter the radius of a circle and calculate its Area and
Circumference

import math

radius = float(input("Enter the radius of the circle: "))

area = math.pi * radius ** 2


circumference = 2 * math.pi * radius

print("Area of the circle is:", area)


print("Circumference of the circle is:", circumference)

You might also like