0% found this document useful (0 votes)
10 views3 pages

7 UI3 Worksheet 1 Anserkey

Uploaded by

shloksaxena434
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)
10 views3 pages

7 UI3 Worksheet 1 Anserkey

Uploaded by

shloksaxena434
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
You are on page 1/ 3

Delhi Public School Ghaziabad

ICT Practice Worksheet-1


Grade 7
UI-3
Answer key

Q1. Choose the correct option and write the justification to support your answer.

1. Which of the following is a valid variable name in Python?


a) Num b) Num#2
c) 2Num d) 2-Num
Justification: Variable names cannot start with a number or contain special characters like # or -. Num is
valid because it starts with a letter and contains no invalid characters.

2. Which operator is used to find the remainder in Python?


a) / b) //
c) % d) **
Justification: The modulus operator % returns the remainder when one number is divided by another.

3. What is the purpose of the print( ) function?


a) Display output b) Take user input
c) Perform a calculation d) Declare variable
Justification: The print() function is used to display output on the screen in Python.

4. Which type of operator is used to compare two values?


a) Arithmetic b) Logical
c) Relational d) String
Justification: Relational operators (like ==, >, <, !=) are used to compare two values.

5. Combining multiple strings into one is called________________.


a) Consolidate b) Concatenation
c) Joining d) Connecting
Justification: The process of combining two or more strings into one is called concatenation.

Q2. Write the statement whether True or False.


1. A flowchart is a visual representation of an algorithm. ____T_________________
2. OR is an assignment operator in Python. _____F______(logical operator)
3. Python is a case-sensitive programming language. ____T_________________
4. Exponential operator is used to compare the values. _____F____(to calculate the power of number)
5. Iterative statements enable the execution of a set of statements to repeat till the condition is true. _T___
6. Higher precedence operators are operated after the lower precedence operators. ____F__(higher is
evaluated before the lower precedence)
Q3. Fill in the blanks.

1. Operators that work on a single operand are called ___Unary___ operators.


2. // operator is used to divide the number and give an output in the ____integer________ form
3. The process of solving a problem step-by-step is called ____Algorithm______.
4. Python allows only ___two____ kinds of operations on string data types.
5. The order in which the operators are evaluated are called ____precedence____ of operators.
6. The _____If-elif-else_________ statements allow performing multiple condition checks in a program.

Q4. Write the answers of the below questions.

1. Differentiate between algorithm and flowchart.

• Algorithm: A step-by-step procedure or set of rules to solve a problem. It is written in a


human-readable form.
• Flowchart: A graphical representation of the algorithm using symbols to represent
operations, decisions, and flow of control.

2. Describe how the if statement works in Python and its syntax.

The if statement is used to check a condition, and if the condition is true, it executes the block of code. It
is used when we have to evaluate only one condition

Syntax:

if <condition>:

Statement 1

Statement 2

3. What is the use of the input () function in python? Explain with the help of example.

The input() function is used to receive input from the user during the program’s execution. It is an
optional string or prompt displayed to the user. Example:

input("Enter the number")

Q5. Write a Python code for the following.

1. Write a Python program to add three numbers. (Take input from the user)

a=int(input("Enter the first no.:"))


b=int(input("Enter the second no.:"))
c=int(input("Enter the third no.:"))
d= a+b+c
print("The sum of three numbers is : ", d)
2. Write a Python program to check if a year is a leap year or not.

a=int(input("Enter the year:"))


if (a%4 == 0):
print("the year is a leap year")
else:
print("the year is not a leap year")

3. Write a Python program to take a string input from the user and print it five times.

a=input("Enter the string:")


print(a*5)

You might also like