0% found this document useful (0 votes)
148 views2 pages

Class XI - IP - Python - Worksheet 2

This worksheet covers Python fundamentals for Class XI, including identifying valid and invalid variable names, writing assignment statements, and determining appropriate data types for various values. It also includes exercises on arithmetic operations and outputs based on given variables. Additionally, there is a programming task to calculate the amount payable on simple interest based on user input for principal, rate, and time.

Uploaded by

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

Class XI - IP - Python - Worksheet 2

This worksheet covers Python fundamentals for Class XI, including identifying valid and invalid variable names, writing assignment statements, and determining appropriate data types for various values. It also includes exercises on arithmetic operations and outputs based on given variables. Additionally, there is a programming task to calculate the amount payable on simple interest based on user input for principal, rate, and time.

Uploaded by

alphaxz.9099
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Class XI- Informatics Practices

Worksheet 2
Chapter: Python fundamentals

1. Which of the following identifier names are invalid and why?


a) Serial_no. e) Total_Marks
b) 1st_Room. f) total-Marks
c) Hundred$ g) _Percentage
d) Total Marks. h) True

[Link] the corresponding Python assignment statements:


a) Assign 10 to variable length and 20 to variable breadth.
b) Assign the average of values of variables length and breadth to a variable sum.
c) Assign a list containing strings ‘Paper’, ‘Gel Pen’, and ‘Eraser’ to a variable stationery.
d) Assign the strings ‘Mohandas', ‘Karamchand’, and ‘Gandhi’ to variables first, middle and last.
e) Assign the concatenated value of string variables first, middle and last to variable fullname.
Make sure to incorporate blank spaces appropriately between different parts of names.
3. Which data type will be used to represent the following data values and why?
a) Number of months in a year
b) Resident of Delhi or not
c) Mobile number
d) Pocket money
e) Volume of a sphere
f) Perimeter of a square
g) Name of the student
h) Address of the student
4. Give the output of the following when num1 = 4, num2 = 3, num3 = 2
a) num1 += num2 + num3
b) print (num1)
c) num1 = num1 ** (num2 + num3)
d) print (num1)
e) num1 **= num2 + c
f) num1 = '5' + '5'
g) print(num1)
h) print(4.00/(2.0+2.0))
i) num1 = 2+9*((3*12)-8)/10
j) print(num1)
k) num1 = float(10)
l) print (num1)
m) num1 = int('3.14')
n) print (num1)
o) print(10 != 9 and 20 >= 20)
p) print(5 % 10 + 10 < 50 and 29 <= 29)
6. Write a Python program to calculate the amount payable if money has been lent on simple
interest. Principal or money lent = P, Rate = R% per annum and Time = T years. Then Simple
Interest (SI) = (P x R x T)/ 100.
Amount payable = Principal + SI.
P, R and T are given as input to the program.

You might also like