0% found this document useful (0 votes)
5 views

XI (CS) Introduction To Python-WS2

This document contains a worksheet on Python fundamentals with multiple choice questions, code snippets to find the output, error identification and correction exercises, writing equivalent Python expressions, and programming exercises to convert currency, swap numbers, and calculate time for an electron's velocity to double.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

XI (CS) Introduction To Python-WS2

This document contains a worksheet on Python fundamentals with multiple choice questions, code snippets to find the output, error identification and correction exercises, writing equivalent Python expressions, and programming exercises to convert currency, swap numbers, and calculate time for an electron's velocity to double.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

MSD/2024-25/Worksheets/ XI/CS/WS1/Introduction to Python/ Pg.

1 of 2

Name:
Class: XI
Section:
Subject: CS
Date:
Session: 2024-25
Topic: Python Fundamentals
Worksheet - 2

1. Find the output produced by the following code fragments.

(i) x, y = 6,5
x, y, x, y = x+1, y+4 , x+15 , y-4
print(x,y)

(ii) print(12%5 * 3 + (2*6)//4)

(iii) y,y = 12, 13


y,x = x/2 , y / 2
print(x,y)
print(type(x), type(y))
(iv) a,b,c =10,20,30
p,q,r = c-5, a+3, b-3
print(‘a, b, c :’,a, b, c, end= “”, sep= “,”)
print(‘p, q, r :’ ,p, q, r)

(v) p = 21//5
q = p%4
r = p*q
p+= p+q-r
r*= p-q+r
q+= p+q
print(p, q, r)
(vii) a = True
b = False
print( a and b or b and not a)
MSD/2024-25/Worksheets/ XI/CS/WS1/Introduction to Python/ Pg. 2 of 2

2. Find the error in the following code. Rewrite the correct code.

(i) A= 3
S = A+10
A = ‘New’
Q = A/10
(ii) Temp = 90
Print Temp

(iii) 600 = num

(iv) z, p = 10

(v) A = 10
B = 5
A, B = A*2, A%5
print(A/B)

3. Write Python expressions equivalent to the following:

(i) 3 +9
2
(ii) 6 ∗ 𝑠𝑢𝑚
8−6+
7
(iii) Add remainder of 8/3 to the product of 8 and 3
(iv) Find the sum of square of 8 and 5

4. Write a program that takes amount in rupees and convert them in dollars. (1 dollars = Rs
79.85)
5. Write a program to read three numbers and swap first number with third number, second
number with first number and first number with the sum of first and second.
6. An electron moving with a velocity of 5 × 10 𝑚/𝑠 enters into a uniform electric field and
acquires a uniform acceleration of 10 𝑚/𝑠 in the direction of initial velocity. Write a
program to calculate the time in which electron velocity will be doubled? [v = u+at]

You might also like