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

Resource 20241118174358 Class 7 November Content Chapter-4 More On Python

Uploaded by

sharminnabab7
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)
26 views3 pages

Resource 20241118174358 Class 7 November Content Chapter-4 More On Python

Uploaded by

sharminnabab7
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/ 3

Delhi Public School, Bhopal Class: 7

Chapter 4: More On Python


Key Terms:
● Algorithm:It is a set of sequential steps to solve any logical or
mathematical problem.
● Precedence: It is the rule that specifies the order in which certain
operations need to be performed in an expression.

Que 1. What do you mean by an operator and an expression?


Ans: Operators are symbols that perform arithmetic and logical operations
on operands and provide a meaningful result. An operator needs one or
more operands to perform any operations.
A valid combination of both operands and operators makes an expression
which returns a computed result.

Que 2. What is the difference between the / and // operators,


give examples?
Ans: ‘/ ' and '//' both are Binary Arithmetic Operators.
/ (Division) operator is used to divide the numbers and give an output in
the decimal form, e.g., Value of 5/2 is 2.5. whereas, // (Floor Division)
divides the numbers and gives an output in the integer form, e.g., Value of
5//2 is 2 and the Value of -5//2 is -3.

Que 3. What is the use of * operator in string manipulation?


Write the other name of * operator.
Ans: * operator in a string manipulation is used to replicate a given string
for a number of times. It is also known as Replication Operator.

Que 4. Name the different types of control structures.


Ans: The different types of control structures are Sequential statements,
Conditional statements, and Iterative statements.

Que 5. Differentiate between unary and binary arithmetic


operators with example.
Ans:
Unary Operator Binary Operator
Delhi Public School, Bhopal Class: 7

1. These operators operate only 1. These operators operate on


on one operand. two operands.
Eg. a=+100, b=-50 Eg. 13+2 ,15/5

Que 6. Write Python Code for the following:


i. Enter a name by the user and display it 5 times.
N=input('Enter a name = ')
print (N*5)

ii. Enter the length and breadth by the user and


calculate the AREA OF RECTANGLE.
L=float (input('Enter the length of the rectangle='))
B=float (input('Enter the breadth of the rectangle='))
A=L*B
print('Area of the Rectangle = ',A)

iii. Enter the name and age of the user and check age if
age is greater than 18 then display allowed to vote else
not.
n=input('Enter name =')
age=int(input('Enter age ='))
if age >=18:
print ('allowed to vote.')
else:
print (' not allowed to vote.')

iv. Enter 2 numbers by the user and display the result of


floor division and modulus.
n1=int(input('Enter a number ='))
n2=int(input('Enter another number ='))
print (‘floor division=',n1//n2)
print ('Modulus =',n1%n2)

v. Enter a number by the user and display whether the


number is negative or positive.
n=int(input('Enter a number ='))
if n<0:
print('Entered Number is negative')
else:
print('Entered Number is positive')
Delhi Public School, Bhopal Class: 7

Home-Work Questions:
1. Write the full form of IDLE in Python IDLE.
2. Define
a. Sequential statements
b. Iterative statements
***

Chapter 4: More On Python 🡪 Page 98


Fillups: Application Based:
1. Precedence 1. % (Modulus Operator)
2. Expression 2. if... else control structure
3. + MCQs:
4. Control 1. (a) Operands
5. if else 2. (b) False
6. Colon 3. (b) Sequential
True False: 4. (c) Iterative
1. False 5. (a) else
2. False Name the following:
3. True 1. + and -
4. True 2. and, or, not
5. False 3. + and *
6. True 4. If Statement
5. Algorithm

***

You might also like