DLF PUBLIC SCHOOL
Python Practice WS1
1. Write the python statements to achieve the following.
a. To display “This is my first program in python”.
b. To display your name.
c. To display the square of 5
d. To display the cube of 3
e. To input 2 numbers, add them and show result.
f. To input name and age of person and show output.
g. To input marks of any 2 subjects and show the total
and average
h. WAP to calculate area of a square. Accept the side
from the programmer.
i. WAP to compute the area of rectangle. Accept the
length and breadth of the rectangle.
j. WAP to compute the circumference of a circle. Accept
the radius of the circle.
k. WAP to accept a number from the user and print its
square and its cube.
2. Write the output of the following statements.
1. 100%3 =________________
2. 100//3= _______________
3. 91/4 =______________
4. 30+10-20 = ______________
5. 100*10 =_______________
6. 2**4=_______________
3. Fill in the blanks.
1. ____________________ is the extension for PYTHON.
2. __________________ and _____________ are the two
modes of PYTHON.
3. ___________________ is the shortcut key to run a
PYTHON program.
4. The datatype for 14.2 is _____________________
5. The datatype for 89 is _________________
6. The datatype to represent a true value is
_______________
7. __________________ is used to display the output on
the screen.
8. PYTHON is ______________ , _______________________
language and platform____________________ .
9. _____________,_______________ ,__________________ and
____________ are the datatypes in PYTHON.
10. _______________ operator gives the remainder
in PYTHON.
11. _______________ operator is used for division
and discards the fractional part.
12. // is called ___________________________________
13. _______________ operator is used to square a
number.
14. There are two types of comments in
PYTHON .They are ______________________
and__________________________
15. _____________________ is called exponent
operator.
16. ___________________ is the shortcut to save a
python file.
17. IDLE stands for _____________________________
18. A _______________ is a named memory location
that stores data and whose value may change
during program execution.
19. A ______________ determines the type of data
stored in a variable.
20. A python program can be saved in the
________________ mode.
21. _______________ is the term used in
programming languages to find errors.
4. Write the purpose of the following :
(1) input()
(2) float()
(3) print()
(4) int()
(5) #
(6) “”
(8) string