XI (CS) Introduction To Python-WS2
XI (CS) Introduction To Python-WS2
1 of 2
Name:
Class: XI
Section:
Subject: CS
Date:
Session: 2024-25
Topic: Python Fundamentals
Worksheet - 2
(i) x, y = 6,5
x, y, x, y = x+1, y+4 , x+15 , y-4
print(x,y)
(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
(iv) z, p = 10
(v) A = 10
B = 5
A, B = A*2, A%5
print(A/B)
(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]