Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
6 views7 pages

Python Practical Assignment 1

The document contains a series of Python programming assignments for Class IX students at N.C. Jindal Public School, Punjabi Bagh. Each assignment includes a problem statement, sample inputs, and expected outputs for various operations such as addition, multiplication, calculating simple interest, and decision-making using conditional statements. The assignments aim to teach basic programming concepts and logic in Python.

Uploaded by

youtubyu13
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)
6 views7 pages

Python Practical Assignment 1

The document contains a series of Python programming assignments for Class IX students at N.C. Jindal Public School, Punjabi Bagh. Each assignment includes a problem statement, sample inputs, and expected outputs for various operations such as addition, multiplication, calculating simple interest, and decision-making using conditional statements. The assignments aim to teach basic programming concepts and logic in Python.

Uploaded by

youtubyu13
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/ 7

N.C.

JINDAL PUBLIC SCHOOL, PUNJABI BAGH


CLASS-IX
PRACTICAL ASSIGNMENT-PYTHON
Q1.WAP TO ADD 10 AND 20. DISPLAY THE SUM?
Sol. a=10 OUTPUT:-

b=20 30

c=a+b
print (c)
Q2. WAP TO MULTIPLY 1.56 AND 2 DISPLAY THE RESULT?
SOL. a=1.56
b=2 OUTPUT:-

3.12
c=a*b
print (c)
Q3. WAP TO FIND SIMPLE INTEREST. PRINCIPAL IS 1443.2,
TIME IS 3 YRS AND RATE IS 2.5 %
SOL. p=1443.2
r= 2.5 OUTPUT:-

108.24
t=3
si= (p*r*t)/100
print (“Simple Interest is:-“ , si)
Q4. WAP TO ADD TWO NUMBERS. DISPLAY THE RESULT
SOL a= int (input (“ENTER FIRST NUMBER :”)) Suppose

b= int (input (“ENTER SECOND NUMBER :”)) a=10

b=20
c= a+b OUTPUT:-30

print (“sum of two number is:- “ ,c)

Q5. WAP TO MULTIPLY THREE NUMBERS.DISPLAY THE RESULT.

SOL. a= int (input (“enter first number”))

b= int (input (“enter second number”)) Suppose

a=10
c= int (input (“enter third number”)) b=2

c= 5
d= a*b*c
OUTPUT:-100

print (“product of three number is:” , d)

Q6. WAP TO ADD THREE NUMBERS. FIRST NUMBER IS


DECIMAL NUMBER, SECOND AND THIRD NUMBER ARE NOT IS
DECIMAL. DISPLAY THE RESULT.

SOL. a=float (input (“ENTER FIRST NUMBER”))

b=int (input (“ENTER SECOND NUMBER”))

c= int (input (“ENTER THIRD NUMBER”) Suppose

a=5.5

d=a+b+c b=20

c= 10
print (“sum of three number is:” , d) OUTPUT:-35.5
Q7. WAP TO CALCULATE AREA OF SQUARE.

SOL. s=int (input (“ENTER SIDE”)) Suppose

S= 9
a=s*s
OUTPUT:-81

print (“Area of Square is:” , a)

Q8. WAP TO CALCULATE AREA OF RECTANGLE.

SOL. l=int (input (“ENTER LENGTH”))

b=int (input (“ENTER BREADTH”)) Suppose

l= 9

a=l*b b=5

OUTPUT:-45
print (“Area of Rectangle is:” , a)

Q9. WAP TO CALCULATE SIMPLE INTEREST

SOL. p=int (input (“ENTER PRINCIPAL AMOUNT”))

r=int (input (“ENTER RATE”))

t=int (input (“ENTER TIME”))

si=(p*r*t)/100
print (“Simple Interest is:” , si)

DECISION MAKING IN PYTHON

Q. WAP TO INPUT ONE NUMBER FFROM THE USER. PRINT


“HELLO ALL” IF THE NUMBE IS GREATER THAN 10?

SOL. a=int (input (“ENTER ANY NUMBER”)) CASE 1-- Suppose

a=20
if a>10: OUTPUT:- HELLO ALL

CASE 2-- Suppose


print(“HELLO ALL”) a=8

THEN TERE WILL BE NO OUTPUT

Q. WAP TO INPUT ONE NUMBER FROM THE USER. PRINT


“HELLO ALL”IF THE NUMBER IS GREATER THAN 10,
OTHERWISE PRINT “HI! HOW ARE YOU ALL?”

SOL. a=int (input(“ENTER ANY NUMBER”))


CASE 1-- Suppose
if a>10:
a=20

print (“HELLO ALL) OUTPUT:- HELLO ALL

CASE 2-- Suppose


else: a=8

OUTPUT:- HI! HOW ARE YOU?


print (“HI! HOW ARE YOU ALL?”)
Q. WAP TO INPUT ONE NUMBER FROM THE USER. PRINT
“YOU HAVE WIN LUCKY DRAW” IF THE NUMBER IS 100,
OTHERWISE PRINT “TRY YOUR LUCK AGAIN”.

SOL. a=int (input (“ENTER ANY NUMBER”))

if a==100:

print (“YOU HAVE WON LUCKY DRAW”)


CASE 1-- Suppose
else:
a=100

OUTPUT:-YOU HAVEE WON


print (“TRY YOUR LUCK AGAIN”) LUCKY DRAW

CASE 2-- Suppose

a=90

OUTPUT:- TRY YOUR LUCK AGAIN

Q. WAP TO INPUT ONE NUMBER FROM THE USER. PRINT


“INTELIGENT” IF THE NUMBER IS GREATER THAN 60,
OTHERWISE PRINT “NALAYAK PADHLE”

SOL. a= int (input (“ENTER ANY NUMBER”))


CASE 1-- Suppose

if a>60: a=50

OUTPUT:- NALAYAK PADHLE

print (“INTELLIGENT”) CASE 2-- Suppose

a=90

OUTPUT:- INTELLIGENT
else:

print (“NALAYAK PADHLE”)

Q. WAP TO INPUT ONE NUMBER FROM THE USER. CHECK


WHETHER THE NUMBER IS EVEN OR ODD.

SOL. a= int (input (“ENTER ANY NUMBER”))


CASE 1-- Suppose

if a%2==0: a=4

OUTPUT:- EVEN
print (“EVEN”) CASE 2-- Suppose

a=9
else: OUTPUT: ODD

print (“ODD”)

Q. WAP TO INPUT AGE OF APERSON FROM THE USER. CHECK


WHETHER THEPERSON IS ELIGBLE TO VOTE OR NOT.

SOL. age = int (input (“enter your age”)

if age>=18: CASE 1-- Suppose

a=10
print (“You are eligible to vote”) OUTPUT:-YOU ARE OT ELIGIBLE

CASE 2-- Suppose


else: a=90

OUTPUT:- YOU ARE ELIGIBLE TO


print (“you are not eligible”) VOTE
Q. WAP TO CHECK THE GRADE OF THE STUDENT ACCORDING
TO MARKS SCORED.

SOL. m = int (input (“enter your marks”)

if m>=91:

print (“A+”)

elif m>=81:

print (“A”)

elif m>=71:

print (“B+”)

elif m>=61:

print (“B”)

elif m>=51:

print (“C”)

elif m>=41:

print (“D”)

else:

print (“you are not eligible”)

You might also like