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

Comp CH 1 WS3

The document provides examples of using lists, tuples and dictionaries in Python. It includes questions about the differences between lists and tuples, ordered vs unordered collections, accessing values from a dictionary and importing math functions.

Uploaded by

priya.akshay
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)
16 views2 pages

Comp CH 1 WS3

The document provides examples of using lists, tuples and dictionaries in Python. It includes questions about the differences between lists and tuples, ordered vs unordered collections, accessing values from a dictionary and importing math functions.

Uploaded by

priya.akshay
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/ 2

1 Write a program to enter any money and find out number of

denominations can be used to make that money. For e.g. if the money
entered is 2560
Then output should be
2000 = 1
500 = 1
200 = 0
100 =0
50 =1
20 = 0
10 = 1
5 = 0
2 = 0
1 = 0
Hint : use % and // operator
Consider a list:
MyFamily = [“Father”,”Mother”,”Brother”,”Sister”,”Jacky”]

 write statement to print “Brother”


 write statement to print all items of list in reverse order
2
 write statement to check “Sister” is in MyFamily or not
 write statement to update “Jacky” with “Tiger”
 write statement remove “Jacky” from MyFamily and also print
it
 write statement to add “Tommy” in MyFamily at the end
Consider a Tuple:
Record = (10,20,30,40)
Raj wants to add new item 50 to tuple, and he has written
expression as
3
Record = Record + 50, but the statement is giving an error, Help
Raj in writing correct expression.
Correct Expression :

4 What is the difference between List and Tuple?


5 What is the difference between List and String?

WORKSHEET-3
CH-PYTHON REVISION TOUR -1
6 What is ordered and unordered collection? Give example of each
Consider a Dictionary
Employee = {“Empno”:1,‟Name”:‟Snehil”,‟Salary”:80000}
Write statements:
7
(i) to print employee name
(ii) to update the salary from 80000 to 90000
(iii) to get all the values only from the dictionary
Num = 100
Isok = False
8 print(type(Num)) =
print(type(Isok)) =

Name the Python Library module which need to be imported to invoke


the following function:
 floor()
9
 randrange()
 randint()
 sin()
Rewrite the following code in python after removing all syntax
error(s). Underline each correction done in the code.
30=To
for K in range(0,To)
10
IF k%4==0:
print (K*4)
Else:
print (K+3)

You might also like