Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Samriddhi School

Swoyambhu, Kathmandu

Project Work On
Python
Submitted By :- Submitted To:-
Name: Miss Leeza Maharjan
Class : 8 “Manaslu” Computer Teacher
Roll no. :
Qn.1: Write A Program to print a string given below:
Hello, I am a student . I study in grade 8 Manaslu . I study in
Samriddhi School. I live in Kathmandu with my family. I live in
Nepal.

 print (“Hello, I am a student . I study in grade 8 Manaslu . I study


in Samriddhi School. I live in Kathmandu with my family. I live
in Nepal.”)

Output:
Hello, I am a student . I study in
grade 8 Manaslu . I study in Samriddhi
School. I live in Kathmandu with my
family.

Qn.2 : Write A Program to print whether the given character is vowel or


consonant. (Use Elif Statement).

z==“b”
if z==“a”:
print(“It is a vowel”)
elif z==“e”:
print(“It is a vowel”)
elif z==“i”:
print(“It is a vowel”)
elif z==“o”:
print(“It is a vowel”)
elif z==“u”:
print(“It is a vowel”)
else :
print(“It is a consonant”)
Output:
It is a consonant

Qn.3: Write A Program to print houseprice by user.(Use Elif Statement)

House price=int.(input(“Please enter desired house price”))


if houseprice >=Rs 3,000 and houseprice <=Rs 10,000:
print(“Economy”)
elif houseprice >=Rs 11,000 and houseprice <=Rs 15,000:
print(“Medium”)
elif houseprice >=Rs 16,000 and houseprice <=Rs 20,000:
print(“High”)
elif houseprice >Rs 20,000
print(“Luxury”)
else :
print(“Please enter valid house price”)

Output:
Please enter valid house price

Qn.4: Write A Program to print a is greater than b

a==5
b==3
if a<b:
print (“a is less than b”)
if a==b:
print (“a is equal to b”)
else :
print (“a is greater than b”)

Output:
a is greater than b

Qn.5: Write A Program to print the value of third array


element.

Menu =[“Dumpling”, ”Noodles”, ”Spring rolls”, “Cakes”, “


Drinks”]
a=Menu[2]
print (a)

Output:
‘Spring rolls’

You might also like