Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

 

  Hiranandani Foundation School International 


2022-2023
SUBJECT: ICT GRADE – VIII DATE:28 Nov, 2022

STUDENT`S NAME: TOPIC – Python WORKSHEET - 05

FILL IN THE BLANKS.


1. guido van rossum is the developer of PYTHON
2. .py is the extension for PYTHON.
3. Interpreter and Compiler are the two modes of PYTHON.
4. F5 is the shortcut key to run a PYTHON program.
5. The data type for 14.2 isFloat
6. The data type for 89 is Integer
7. The data type to represent a true value is Boolean
8. PYTHON is an interpreted, object-oriented, high-level programming language with dynamic
semantics.
9. Int,String,Float,boolean are the data types in PYTHON.
10. modulus(%) operator gives the remainder in PYTHON.
11.___Floor division(//)__ operator is used for division and discards the fractional part.
12. The EXPONENT(**) operator is used to square a number.
13. There are two types of comments in PYTHON .They are single line and multiline .
14. Single line comments start with # Multi-line comments start with """ """
15. IDLE stands for INTEGRATED DEVELOPMENT AND LEARNING ENVIRONMENT
16. A VARIABLE is a named memory location that stores data and whose value may
change during program execution.
17. ’+’ operator is called CONCATENATION operator when used with strings.
18. DEBUGGING is the term used in programming languages to find errors.
19. SYNTAX refers to the grammatical rules of any programming language.
20. Write the python statements to achieve the following.
● To display “ANITA” 3 times(Note:-use print only once).

ANS. >>>print(“ANITA”*3)

● To display the square of 5.

ANS. >>>(“SQUARE OF 5= “5**2)

21. Write the output of the following statements.


● 100%3 =1
● 100//3=33
● 91/4 =22.75
● 2**4= 16
Solve the following question practically and stick the output in the Notebook.

1. Write a program to iterate the first 10 numbers and in each iteration, print the sum of the
current and previous number.

2. Iterate the given list of numbers and print only those numbers which are divisible by 5

3. Write a program to find how many times substring “Emma” appears in the given string.
4. Given a list of numbers. write a program to turn every item of a list into its square.

5. Write a program to print the following number pattern using a loop.

6. Write a program to print multiplication table of a given number


7. Write a program to display all prime numbers within a range

8. Write a Python program to sum all the items in a list.


What will be the output of following program:

list1 = ["python", "list", 1952, 2323, 432]


list2 = ["this", "is", "another", "list"]
print(list1)
print(list1[1:4])
print(list1[1:])
print(list1[0])
print(list1 * 2)
print(list1 + list2)

What will be the output of following program:


names = ['Hardik', 'Virat', 'Rahul', 'Dhavan']
print(names[-1][-1])
For Reference:-

You might also like