Grade 10 Python Programming
Grade 10 Python Programming
"""
👇
x=5
x=5+5
x=15-1
print(x)
print(x+5)
"""
# datatypes in py
'''
number=10
real=10.2
char='a'
string="Hello"
boolean=True
print(number,real,char,string,boolean)
'''
'''
#QUESTION 1
#calculate the volume of a sphere
'''
radius=float(input("Enter the radius of the circle:"))
sphere_volume=(4/3)*3.14*radius**3 #radius to the power
of 3
print("sphere volume is",sphere_volume)
'''
#Question 2
#calculate the volume of a cylinder
'''
import math
Radius=float(input("enter the radius of the circle:"))
Height=float(input("enter the height of the cylinder:"))
volume_cylinder=3.14*Radius**2*Height
print ("volume of the cylinder is",volume_cylinder)
rounded_cylinder=round(volume_cylinder,2)
print(rounded_cylinder)
cieled_cylinder=[Link](volume_cylinder)
floored_cylinder=[Link](volume_cylinder)
print(cieled_cylinder)
print(floored_cylinder)
'''
#question 4
''''
#GRADES
Grade = (input("enter the grade:"))
if Grade=="A":
print("Excellent")
elif Grade=="B":
print("Good")
elif Grade=="C":
print("Average")
elif Grade=="D":
print("Below Average")
elif Grade=="F":
print("Fail")
print("Better luck next time")
'''
'''
#Question 5
#Even or odd
Number=int(input("Enter the number:"))
if Number%2==0:
print("Even")
else:
print("Odd")
'''
#question 6
#To find wheather the character is vowel or not
'''
character=input("enter the character:")
if character=='a':
print(character,'is vowel')
elif character=='e':
print(character,'is vowel')
elif character=='i':
print(character,'is vowel')
elif character=='o':
print(character,'is vowel')
elif character=='u':
print(character,"is vowel")
elif character=='b' or character=='c' or character=='d' or
character=='e' or character=='f' or character=='g' or
character=='h' or character=='i' or character=='j' or
character=='k' or character=='l' or character=='m' or
character=='n' or character=='o' or character=='p' or
character=='q' or character=='r' or character=='s' or
character=='t' or character=='u' or character=='v' or
character=='w' or character=='x' or character=='y'or
character=='z':
print(character,"is consonant")
'''
#to increment by 2
for counter in range(1,20,2):
print(counter)
'''
1#DAY -2
'''
#TASK 2
#USE FOR LOOP TO OUTPUT FROM 10 TO 0
'''
Countdown_Timer=0
for Countdown_Timer in range(10,-1,-1):
print(Countdown_Timer)
'''
#Task 3
Value=10
while(Value<=10):
Value=Value-1
print(Value)
if(Value==-1):
break
'''
#OR WE CAN USE to simply print from 10 to 0
'''
value=10
while value>=0:
print(value)
value=value-1
'''
#TASK 4 WRITE A PROGRAM TO INPUT NUMBERS
REPEATEDLY UNTIL THE USER ENTERS A POSITIVE
NUMBER
'''
number=int(input("enter the number:"))
while True:
if number<0:
number=int(input("enter the number:"))
else:
break
print("positive number entered")
#or
total=0
n=number
for i in range(1,n+1):
total=total+i
print("The total sum from 1 to", number, "is:", total)
'''
# datatypes in py
'''
number=10
real=10.2
char='a'
string="Hello"
boolean=True
print(number,real,char,string,boolean)
'''
'''
#QUESTION 1
#calculate the volume of a sphere
'''
radius=float(input("Enter the radius of the circle:"))
sphere_volume=(4/3)*3.14*radius**3 #radius to the power
of 3
print("sphere volume is",sphere_volume)
'''
#Question 2
#calculate the volume of a cylinder
'''
import math
Radius=float(input("enter the radius of the circle:"))
Height=float(input("enter the height of the cylinder:"))
volume_cylinder=3.14*Radius**2*Height
print ("volume of the cylinder is",volume_cylinder)
rounded_cylinder=round(volume_cylinder,2)
print(rounded_cylinder)
cieled_cylinder=[Link](volume_cylinder)
floored_cylinder=[Link](volume_cylinder)
print(cieled_cylinder)
print(floored_cylinder)
'''
#question 4
''''
#GRADES
Grade = (input("enter the grade:"))
if Grade=="A":
print("Excellent")
elif Grade=="B":
print("Good")
elif Grade=="C":
print("Average")
elif Grade=="D":
print("Below Average")
elif Grade=="F":
print("Fail")
print("Better luck next time")
'''
'''
#Question 5
#Even or odd
Number=int(input("Enter the number:"))
if Number%2==0:
print("Even")
else:
print("Odd")
'''
#question 6
#To find wheather the character is vowel or not
'''
character=input("enter the character:")
if character=='a':
print(character,'is vowel')
elif character=='e':
print(character,'is vowel')
elif character=='i':
print(character,'is vowel')
elif character=='o':
print(character,'is vowel')
elif character=='u':
print(character,"is vowel")
elif character=='b' or character=='c' or character=='d' or
character=='e' or character=='f' or character=='g' or
character=='h' or character=='i' or character=='j' or
character=='k' or character=='l' or character=='m' or
character=='n' or character=='o' or character=='p' or
character=='q' or character=='r' or character=='s' or
character=='t' or character=='u' or character=='v' or
character=='w' or character=='x' or character=='y'or
character=='z':
print(character,"is consonant")
'''
#to increment by 2
for counter in range(1,20,2):
print(counter)
'''
#PRECONDITION LOOP -CONDTION MUST BE TRUE
BEFORE THE LOOP STARTS
#(while loop-number of loops is not known or predecided)
'''
Total=0
print("Enter the numbers to be added until -1 to finish:")
Mark=int(input("Enter the number:"))
while Mark!=-1: #condtion must be met before the
indented code is executed
Total=Total+Mark
Mark=int(input("Enter the number:"))
print("Total is",Total)
'''
1#DAY -2
'''
#TASK 2
#USE FOR LOOP TO OUTPUT FROM 10 TO 0
'''
Countdown_Timer=0
for Countdown_Timer in range(10,-1,-1):
print(Countdown_Timer)
'''
#Task 3
'''
#why 10 is not printed in the below code and -1 is printed
Value=10
while(Value<=10):
Value=Value-1
print(Value)
if(Value==-1):
break
'''
#OR WE CAN USE to simply print from 10 to 0
'''
value=10
while value>=0:
print(value)
value=value-1
'''
#TASK 4 WRITE A PROGRAM TO INPUT NUMBERS
REPEATEDLY UNTIL THE USER ENTERS A POSITIVE
NUMBER
'''
number=int(input("enter the number:"))
while True:
if number<0:
number=int(input("enter the number:"))
else:
break
print("positive number entered")
#or
total=0
n=number
for i in range(1,n+1):
total=total+i
print("The total sum from 1 to", number, "is:", total)
'''
# datatypes in py
'''
number=10
real=10.2
char='a'
string="Hello"
boolean=True
print(number,real,char,string,boolean)
'''
'''
#QUESTION 1
#calculate the volume of a sphere
'''
radius=float(input("Enter the radius of the circle:"))
sphere_volume=(4/3)*3.14*radius**3 #radius to the power
of 3
print("sphere volume is",sphere_volume)
'''
#Question 2
#calculate the volume of a cylinder
'''
import math
Radius=float(input("enter the radius of the circle:"))
Height=float(input("enter the height of the cylinder:"))
volume_cylinder=3.14*Radius**2*Height
print ("volume of the cylinder is",volume_cylinder)
rounded_cylinder=round(volume_cylinder,2)
print(rounded_cylinder)
cieled_cylinder=[Link](volume_cylinder)
floored_cylinder=[Link](volume_cylinder)
print(cieled_cylinder)
print(floored_cylinder)
'''
#question 4
''''
#GRADES
Grade = (input("enter the grade:"))
if Grade=="A":
print("Excellent")
elif Grade=="B":
print("Good")
elif Grade=="C":
print("Average")
elif Grade=="D":
print("Below Average")
elif Grade=="F":
print("Fail")
print("Better luck next time")
'''
'''
#Question 5
#Even or odd
Number=int(input("Enter the number:"))
if Number%2==0:
print("Even")
else:
print("Odd")
'''
#question 6
#To find wheather the character is vowel or not
'''
character=input("enter the character:")
if character=='a':
print(character,'is vowel')
elif character=='e':
print(character,'is vowel')
elif character=='i':
print(character,'is vowel')
elif character=='o':
print(character,'is vowel')
elif character=='u':
print(character,"is vowel")
elif character=='b' or character=='c' or character=='d' or
character=='e' or character=='f' or character=='g' or
character=='h' or character=='i' or character=='j' or
character=='k' or character=='l' or character=='m' or
character=='n' or character=='o' or character=='p' or
character=='q' or character=='r' or character=='s' or
character=='t' or character=='u' or character=='v' or
character=='w' or character=='x' or character=='y'or
character=='z':
print(character,"is consonant")
'''
#to increment by 2
for counter in range(1,20,2):
print(counter)
'''
1#DAY -2
'''
#TASK 2
#USE FOR LOOP TO OUTPUT FROM 10 TO 0
'''
Countdown_Timer=0
for Countdown_Timer in range(10,-1,-1):
print(Countdown_Timer)
'''
#Task 3
'''
#why 10 is not printed in the below code and -1 is printed
Value=10
while(Value<=10):
Value=Value-1
print(Value)
if(Value==-1):
break
'''
#OR WE CAN USE to simply print from 10 to 0
'''
value=10
while value>=0:
print(value)
value=value-1
'''
#TASK 4 WRITE A PROGRAM TO INPUT NUMBERS
REPEATEDLY UNTIL THE USER ENTERS A POSITIVE
NUMBER
'''
number=int(input("enter the number:"))
while True:
if number<0:
number=int(input("enter the number:"))
else:
break
print("positive number entered")
#or
total=0
n=number
for i in range(1,n+1):
total=total+i
print("The total sum from 1 to", number, "is:", total)
'''
'''
#Question 2
#calculate the volume of a cylinder
'''
import math
Radius=float(input("enter the radius of the circle:"))
Height=float(input("enter the height of the cylinder:"))
volume_cylinder=3.14*Radius**2*Height
print ("volume of the cylinder is",volume_cylinder)
rounded_cylinder=round(volume_cylinder,2)
print(rounded_cylinder)
cieled_cylinder=[Link](volume_cylinder)
floored_cylinder=[Link](volume_cylinder)
print(cieled_cylinder)
print(floored_cylinder)
'''
#question 4
''''
#GRADES
Grade = (input("enter the grade:"))
if Grade=="A":
print("Excellent")
elif Grade=="B":
print("Good")
elif Grade=="C":
print("Average")
elif Grade=="D":
print("Below Average")
elif Grade=="F":
print("Fail")
print("Better luck next time")
'''
'''
#Question 5
#Even or odd
Number=int(input("Enter the number:"))
if Number%2==0:
print("Even")
else:
print("Odd")
'''
#question 6
#To find wheather the character is vowel or not
'''
character=input("enter the character:")
if character=='a':
print(character,'is vowel')
elif character=='e':
print(character,'is vowel')
elif character=='i':
print(character,'is vowel')
elif character=='o':
print(character,'is vowel')
elif character=='u':
print(character,"is vowel")
elif character=='b' or character=='c' or character=='d' or
character=='e' or character=='f' or character=='g' or
character=='h' or character=='i' or character=='j' or
character=='k' or character=='l' or character=='m' or
character=='n' or character=='o' or character=='p' or
character=='q' or character=='r' or character=='s' or
character=='t' or character=='u' or character=='v' or
character=='w' or character=='x' or character=='y'or
character=='z':
print(character,"is consonant")
'''
1#DAY -2
'''
#TASK 2
#USE FOR LOOP TO OUTPUT FROM 10 TO 0
'''
Countdown_Timer=0
for Countdown_Timer in range(10,-1,-1):
print(Countdown_Timer)
'''
#Task 3
'''
#why 10 is not printed in the below code and -1 is printed
Value=10
while(Value<=10):
Value=Value-1
print(Value)
if(Value==-1):
break
'''
#OR WE CAN USE to simply print from 10 to 0
'''
value=10
while value>=0:
print(value)
value=value-1
'''
#TASK 4 WRITE A PROGRAM TO INPUT NUMBERS
REPEATEDLY UNTIL THE USER ENTERS A POSITIVE
NUMBER
'''
number=int(input("enter the number:"))
while True:
if number<0:
number=int(input("enter the number:"))
else:
break
print("positive number entered")
#or
total=0
n=number
for i in range(1,n+1):
total=total+i
print("The total sum from 1 to", number, "is:", total)
'''
# datatypes in py
'''
number=10
real=10.2
char='a'
string="Hello"
boolean=True
print(number,real,char,string,boolean)
'''
'''
#QUESTION 1
#calculate the volume of a sphere
'''
radius=float(input("Enter the radius of the circle:"))
sphere_volume=(4/3)*3.14*radius**3 #radius to the power
of 3
print("sphere volume is",sphere_volume)
'''
#Question 2
#calculate the volume of a cylinder
'''
import math
Radius=float(input("enter the radius of the circle:"))
Height=float(input("enter the height of the cylinder:"))
volume_cylinder=3.14*Radius**2*Height
print ("volume of the cylinder is",volume_cylinder)
rounded_cylinder=round(volume_cylinder,2)
print(rounded_cylinder)
cieled_cylinder=[Link](volume_cylinder)
floored_cylinder=[Link](volume_cylinder)
print(cieled_cylinder)
print(floored_cylinder)
'''
#question 4
''''
#GRADES
Grade = (input("enter the grade:"))
if Grade=="A":
print("Excellent")
elif Grade=="B":
print("Good")
elif Grade=="C":
print("Average")
elif Grade=="D":
print("Below Average")
elif Grade=="F":
print("Fail")
print("Better luck next time")
'''
'''
#Question 5
#Even or odd
Number=int(input("Enter the number:"))
if Number%2==0:
print("Even")
else:
print("Odd")
'''
#question 6
#To find wheather the character is vowel or not
'''
character=input("enter the character:")
if character=='a':
print(character,'is vowel')
elif character=='e':
print(character,'is vowel')
elif character=='i':
print(character,'is vowel')
elif character=='o':
print(character,'is vowel')
elif character=='u':
print(character,"is vowel")
elif character=='b' or character=='c' or character=='d' or
character=='e' or character=='f' or character=='g' or
character=='h' or character=='i' or character=='j' or
character=='k' or character=='l' or character=='m' or
character=='n' or character=='o' or character=='p' or
character=='q' or character=='r' or character=='s' or
character=='t' or character=='u' or character=='v' or
character=='w' or character=='x' or character=='y'or
character=='z':
print(character,"is consonant")
'''
#to increment by 2
for counter in range(1,20,2):
print(counter)
'''
1#DAY -2
'''
#TASK 2
#USE FOR LOOP TO OUTPUT FROM 10 TO 0
'''
Countdown_Timer=0
for Countdown_Timer in range(10,-1,-1):
print(Countdown_Timer)
'''
#Task 3
'''
#why 10 is not printed in the below code and -1 is printed
Value=10
while(Value<=10):
Value=Value-1
print(Value)
if(Value==-1):
break
'''
#OR WE CAN USE to simply print from 10 to 0
'''
value=10
while value>=0:
print(value)
value=value-1
'''
#TASK 4 WRITE A PROGRAM TO INPUT NUMBERS
REPEATEDLY UNTIL THE USER ENTERS A POSITIVE
NUMBER
'''
number=int(input("enter the number:"))
while True:
if number<0:
number=int(input("enter the number:"))
else:
break
print("positive number entered")
#or
total=0
n=number
for i in range(1,n+1):
total=total+i
print("The total sum from 1 to", number, "is:", total)
'''
# datatypes in py
'''
number=10
real=10.2
char='a'
string="Hello"
boolean=True
print(number,real,char,string,boolean)
'''
'''
#QUESTION 1
#calculate the volume of a sphere
'''
radius=float(input("Enter the radius of the circle:"))
sphere_volume=(4/3)*3.14*radius**3 #radius to the power
of 3
print("sphere volume is",sphere_volume)
'''
#Question 2
#calculate the volume of a cylinder
'''
import math
Radius=float(input("enter the radius of the circle:"))
Height=float(input("enter the height of the cylinder:"))
volume_cylinder=3.14*Radius**2*Height
print ("volume of the cylinder is",volume_cylinder)
rounded_cylinder=round(volume_cylinder,2)
print(rounded_cylinder)
cieled_cylinder=[Link](volume_cylinder)
floored_cylinder=[Link](volume_cylinder)
print(cieled_cylinder)
print(floored_cylinder)
'''
#question 4
''''
#GRADES
Grade = (input("enter the grade:"))
if Grade=="A":
print("Excellent")
elif Grade=="B":
print("Good")
elif Grade=="C":
print("Average")
elif Grade=="D":
print("Below Average")
elif Grade=="F":
print("Fail")
print("Better luck next time")
'''
'''
#Question 5
#Even or odd
Number=int(input("Enter the number:"))
if Number%2==0:
print("Even")
else:
print("Odd")
'''
#question 6
#To find wheather the character is vowel or not
'''
character=input("enter the character:")
if character=='a':
print(character,'is vowel')
elif character=='e':
print(character,'is vowel')
elif character=='i':
print(character,'is vowel')
elif character=='o':
print(character,'is vowel')
elif character=='u':
print(character,"is vowel")
elif character=='b' or character=='c' or character=='d' or
character=='e' or character=='f' or character=='g' or
character=='h' or character=='i' or character=='j' or
character=='k' or character=='l' or character=='m' or
character=='n' or character=='o' or character=='p' or
character=='q' or character=='r' or character=='s' or
character=='t' or character=='u' or character=='v' or
character=='w' or character=='x' or character=='y'or
character=='z':
print(character,"is consonant")
'''
#to increment by 2
for counter in range(1,20,2):
print(counter)
'''
1#DAY -2
'''
#TASK 2
#USE FOR LOOP TO OUTPUT FROM 10 TO 0
'''
Countdown_Timer=0
for Countdown_Timer in range(10,-1,-1):
print(Countdown_Timer)
'''
#Task 3
#countdown using while loop from 10 to 0
'''
Value=100
while(Value<=100):
print(Value)
Value=Value-1
if(Value==-1):
break
'''
'''
#why 10 is not printed in the below code and -1 is printed
Value=10
while(Value<=10):
Value=Value-1
print(Value)
if(Value==-1):
break
'''
#OR WE CAN USE to simply print from 10 to 0
'''
value=10
while value>=0:
print(value)
value=value-1
'''
#TASK 4 WRITE A PROGRAM TO INPUT NUMBERS
REPEATEDLY UNTIL THE USER ENTERS A POSITIVE
NUMBER
'''
number=int(input("enter the number:"))
while True:
if number<0:
number=int(input("enter the number:"))
else:
break
print("positive number entered")
#or
total=0
n=number
for i in range(1,n+1):
total=total+i
print("The total sum from 1 to", number, "is:", total)
'''
# datatypes in py
'''
number=10
real=10.2
char='a'
string="Hello"
boolean=True
print(number,real,char,string,boolean)
'''
'''
#QUESTION 1
#calculate the volume of a sphere
'''
radius=float(input("Enter the radius of the circle:"))
sphere_volume=(4/3)*3.14*radius**3 #radius to the power
of 3
print("sphere volume is",sphere_volume)
'''
#Question 2
#calculate the volume of a cylinder
'''
import math
Radius=float(input("enter the radius of the circle:"))
Height=float(input("enter the height of the cylinder:"))
volume_cylinder=3.14*Radius**2*Height
print ("volume of the cylinder is",volume_cylinder)
rounded_cylinder=round(volume_cylinder,2)
print(rounded_cylinder)
cieled_cylinder=[Link](volume_cylinder)
floored_cylinder=[Link](volume_cylinder)
print(cieled_cylinder)
print(floored_cylinder)
'''
#question 4
''''
#GRADES
Grade = (input("enter the grade:"))
if Grade=="A":
print("Excellent")
elif Grade=="B":
print("Good")
elif Grade=="C":
print("Average")
elif Grade=="D":
print("Below Average")
elif Grade=="F":
print("Fail")
print("Better luck next time")
'''
'''
#Question 5
#Even or odd
Number=int(input("Enter the number:"))
if Number%2==0:
print("Even")
else:
print("Odd")
'''
#question 6
#To find wheather the character is vowel or not
'''
character=input("enter the character:")
if character=='a':
print(character,'is vowel')
elif character=='e':
print(character,'is vowel')
elif character=='i':
print(character,'is vowel')
elif character=='o':
print(character,'is vowel')
elif character=='u':
print(character,"is vowel")
elif character=='b' or character=='c' or character=='d' or
character=='e' or character=='f' or character=='g' or
character=='h' or character=='i' or character=='j' or
character=='k' or character=='l' or character=='m' or
character=='n' or character=='o' or character=='p' or
character=='q' or character=='r' or character=='s' or
character=='t' or character=='u' or character=='v' or
character=='w' or character=='x' or character=='y'or
character=='z':
print(character,"is consonant")
'''
#to increment by 2
for counter in range(1,20,2):
print(counter)
'''
1#DAY -2
'''
#TASK 2
#USE FOR LOOP TO OUTPUT FROM 10 TO 0
'''
Countdown_Timer=0
for Countdown_Timer in range(10,-1,-1):
print(Countdown_Timer)
'''
#Task 3
'''
#why 10 is not printed in the below code and -1 is printed
Value=10
while(Value<=10):
Value=Value-1
print(Value)
if(Value==-1):
break
'''
#OR WE CAN USE to simply print from 10 to 0
'''
value=10
while value>=0:
print(value)
value=value-1
'''
#TASK 4 WRITE A PROGRAM TO INPUT NUMBERS
REPEATEDLY UNTIL THE USER ENTERS A POSITIVE
NUMBER
'''
number=int(input("enter the number:"))
while True:
if number<0:
number=int(input("enter the number:"))
else:
break
print("positive number entered")
#or
total=0
n=number
for i in range(1,n+1):
total=total+i
print("The total sum from 1 to", number, "is:", total)
'''
# datatypes in py
'''
number=10
real=10.2
char='a'
string="Hello"
boolean=True
print(number,real,char,string,boolean)
'''
'''
#input can also be in the form of file .txt .excel
#the default input is string
"""
height=float(input("Enter your height in meters:"))
print("Your height is",height)
"""
#QUESTION 1
#calculate the volume of a sphere
'''
radius=float(input("Enter the radius of the circle:"))
sphere_volume=(4/3)*3.14*radius**3 #radius to the power
of 3
print("sphere volume is",sphere_volume)
'''
#Question 2
#calculate the volume of a cylinder
'''
import math
Radius=float(input("enter the radius of the circle:"))
Height=float(input("enter the height of the cylinder:"))
volume_cylinder=3.14*Radius**2*Height
print ("volume of the cylinder is",volume_cylinder)
rounded_cylinder=round(volume_cylinder,2)
print(rounded_cylinder)
cieled_cylinder=[Link](volume_cylinder)
floored_cylinder=[Link](volume_cylinder)
print(cieled_cylinder)
print(floored_cylinder)
'''
#question 4
''''
#GRADES
Grade = (input("enter the grade:"))
if Grade=="A":
print("Excellent")
elif Grade=="B":
print("Good")
elif Grade=="C":
print("Average")
elif Grade=="D":
print("Below Average")
elif Grade=="F":
print("Fail")
print("Better luck next time")
'''
'''
#Question 5
#Even or odd
Number=int(input("Enter the number:"))
if Number%2==0:
print("Even")
else:
print("Odd")
'''
#question 6
#To find wheather the character is vowel or not
'''
character=input("enter the character:")
if character=='a':
print(character,'is vowel')
elif character=='e':
print(character,'is vowel')
elif character=='i':
print(character,'is vowel')
elif character=='o':
print(character,'is vowel')
elif character=='u':
print(character,"is vowel")
elif character=='b' or character=='c' or character=='d' or
character=='e' or character=='f' or character=='g' or
character=='h' or character=='i' or character=='j' or
character=='k' or character=='l' or character=='m' or
character=='n' or character=='o' or character=='p' or
character=='q' or character=='r' or character=='s' or
character=='t' or character=='u' or character=='v' or
character=='w' or character=='x' or character=='y'or
character=='z':
print(character,"is consonant")
'''
#cout controlled loop(for loop-number of loops is known or
predecided))pyhton does't print the last number)
#counter varaible is incremented by 1 by default
'''
for counter in range(1,10):
print(counter)
#to increment by 2
for counter in range(1,20,2):
print(counter)
'''
1#DAY -2
#POST CONDITION LOOP - CONDITION IS CHECKED
AFTER THE LOOP IS EXECUTED REPEAT UNTIL LOOP
IN PSUEDOCODE ,python does not have repeat until loop
but we can use while loop to achieve the same result
'''
Total=0
Mark=0
while True:
Mark=int(input("Enter the number:"))
if Mark==-1:
break
Total=Total+Mark
print(type(Total))
'''
'''
#TASK 1
#-USE A FOR LOOP TO OUTPUT THE FIRST 5
MULTIPLES OF 3-
'''
#TASK 2
#USE FOR LOOP TO OUTPUT FROM 10 TO 0
'''
Countdown_Timer=0
for Countdown_Timer in range(10,-1,-1):
print(Countdown_Timer)
'''
#Task 3
'''
#why 10 is not printed in the below code and -1 is printed
Value=10
while(Value<=10):
Value=Value-1
print(Value)
if(Value==-1):
break
'''
#OR WE CAN USE to simply print from 10 to 0
'''
value=10
while value>=0:
print(value)
value=value-1
'''
#TASK 4 WRITE A PROGRAM TO INPUT NUMBERS
REPEATEDLY UNTIL THE USER ENTERS A POSITIVE
NUMBER
'''
number=int(input("enter the number:"))
while True:
if number<0:
number=int(input("enter the number:"))
else:
break
print("positive number entered")
#or
total=0
n=number
for i in range(1,n+1):
total=total+i
print("The total sum from 1 to", number, "is:", total)
'''
# datatypes in py
'''
number=10
real=10.2
char='a'
string="Hello"
boolean=True
print(number,real,char,string,boolean)
'''
#QUESTION 1
#calculate the volume of a sphere
'''
radius=float(input("Enter the radius of the circle:"))
sphere_volume=(4/3)*3.14*radius**3 #radius to the power
of 3
print("sphere volume is",sphere_volume)
'''
#Question 2
#calculate the volume of a cylinder
'''
import math
Radius=float(input("enter the radius of the circle:"))
Height=float(input("enter the height of the cylinder:"))
volume_cylinder=3.14*Radius**2*Height
print ("volume of the cylinder is",volume_cylinder)
rounded_cylinder=round(volume_cylinder,2)
print(rounded_cylinder)
cieled_cylinder=[Link](volume_cylinder)
floored_cylinder=[Link](volume_cylinder)
print(cieled_cylinder)
print(floored_cylinder)
'''
#question 4
''''
#GRADES
Grade = (input("enter the grade:"))
if Grade=="A":
print("Excellent")
elif Grade=="B":
print("Good")
elif Grade=="C":
print("Average")
elif Grade=="D":
print("Below Average")
elif Grade=="F":
print("Fail")
print("Better luck next time")
'''
'''
#Question 5
#Even or odd
Number=int(input("Enter the number:"))
if Number%2==0:
print("Even")
else:
print("Odd")
'''
#question 6
#To find wheather the character is vowel or not
'''
character=input("enter the character:")
if character=='a':
print(character,'is vowel')
elif character=='e':
print(character,'is vowel')
elif character=='i':
print(character,'is vowel')
elif character=='o':
print(character,'is vowel')
elif character=='u':
print(character,"is vowel")
elif character=='b' or character=='c' or character=='d' or
character=='e' or character=='f' or character=='g' or
character=='h' or character=='i' or character=='j' or
character=='k' or character=='l' or character=='m' or
character=='n' or character=='o' or character=='p' or
character=='q' or character=='r' or character=='s' or
character=='t' or character=='u' or character=='v' or
character=='w' or character=='x' or character=='y'or
character=='z':
print(character,"is consonant")
'''
#to increment by 2
for counter in range(1,20,2):
print(counter)
'''
'''
#TASK 2
#USE FOR LOOP TO OUTPUT FROM 10 TO 0
'''
Countdown_Timer=0
for Countdown_Timer in range(10,-1,-1):
print(Countdown_Timer)
'''
#Task 3
'''
#why 10 is not printed in the below code and -1 is printed
Value=10
while(Value<=10):
Value=Value-1
print(Value)
if(Value==-1):
break
'''
#OR WE CAN USE to simply print from 10 to 0
'''
value=10
while value>=0:
print(value)
value=value-1
'''
#TASK 4 WRITE A PROGRAM TO INPUT NUMBERS
REPEATEDLY UNTIL THE USER ENTERS A POSITIVE
NUMBER
'''
number=int(input("enter the number:"))
while True:
if number<0:
number=int(input("enter the number:"))
else:
break
print("positive number entered")
#or
total=0
n=number
for i in range(1,n+1):
total=total+i
print("The total sum from 1 to", number, "is:", total)
'''
# datatypes in py
'''
number=10
real=10.2
char='a'
string="Hello"
boolean=True
print(number,real,char,string,boolean)
'''
'''
#QUESTION 1
#calculate the volume of a sphere
'''
radius=float(input("Enter the radius of the circle:"))
sphere_volume=(4/3)*3.14*radius**3 #radius to the power
of 3
print("sphere volume is",sphere_volume)
'''
#Question 2
#calculate the volume of a cylinder
'''
import math
Radius=float(input("enter the radius of the circle:"))
Height=float(input("enter the height of the cylinder:"))
volume_cylinder=3.14*Radius**2*Height
print ("volume of the cylinder is",volume_cylinder)
rounded_cylinder=round(volume_cylinder,2)
print(rounded_cylinder)
cieled_cylinder=[Link](volume_cylinder)
floored_cylinder=[Link](volume_cylinder)
print(cieled_cylinder)
print(floored_cylinder)
'''
#question 4
''''
#GRADES
Grade = (input("enter the grade:"))
if Grade=="A":
print("Excellent")
elif Grade=="B":
print("Good")
elif Grade=="C":
print("Average")
elif Grade=="D":
print("Below Average")
elif Grade=="F":
print("Fail")
print("Better luck next time")
'''
'''
#Question 5
#Even or odd
Number=int(input("Enter the number:"))
if Number%2==0:
print("Even")
else:
print("Odd")
'''
#question 6
#To find wheather the character is vowel or not
'''
character=input("enter the character:")
if character=='a':
print(character,'is vowel')
elif character=='e':
print(character,'is vowel')
elif character=='i':
print(character,'is vowel')
elif character=='o':
print(character,'is vowel')
elif character=='u':
print(character,"is vowel")
elif character=='b' or character=='c' or character=='d' or
character=='e' or character=='f' or character=='g' or
character=='h' or character=='i' or character=='j' or
character=='k' or character=='l' or character=='m' or
character=='n' or character=='o' or character=='p' or
character=='q' or character=='r' or character=='s' or
character=='t' or character=='u' or character=='v' or
character=='w' or character=='x' or character=='y'or
character=='z':
print(character,"is consonant")
'''
#to increment by 2
for counter in range(1,20,2):
print(counter)
'''
1#DAY -2
'''
#TASK 2
#USE FOR LOOP TO OUTPUT FROM 10 TO 0
'''
Countdown_Timer=0
for Countdown_Timer in range(10,-1,-1):
print(Countdown_Timer)
'''
#Task 3
'''
#why 10 is not printed in the below code and -1 is printed
Value=10
while(Value<=10):
Value=Value-1
print(Value)
if(Value==-1):
break
'''
#OR WE CAN USE to simply print from 10 to 0
'''
value=10
while value>=0:
print(value)
value=value-1
'''
#TASK 4 WRITE A PROGRAM TO INPUT NUMBERS
REPEATEDLY UNTIL THE USER ENTERS A POSITIVE
NUMBER
'''
number=int(input("enter the number:"))
while True:
if number<0:
number=int(input("enter the number:"))
else:
break
print("positive number entered")
#or
total=0
n=number
for i in range(1,n+1):
total=total+i
print("The total sum from 1 to", number, "is:", total)
'''
# datatypes in py
'''
number=10
real=10.2
char='a'
string="Hello"
boolean=True
print(number,real,char,string,boolean)
'''
'''
#QUESTION 1
#calculate the volume of a sphere
'''
radius=float(input("Enter the radius of the circle:"))
sphere_volume=(4/3)*3.14*radius**3 #radius to the power
of 3
print("sphere volume is",sphere_volume)
'''
#Question 2
#calculate the volume of a cylinder
'''
import math
Radius=float(input("enter the radius of the circle:"))
Height=float(input("enter the height of the cylinder:"))
volume_cylinder=3.14*Radius**2*Height
print ("volume of the cylinder is",volume_cylinder)
rounded_cylinder=round(volume_cylinder,2)
print(rounded_cylinder)
cieled_cylinder=[Link](volume_cylinder)
floored_cylinder=[Link](volume_cylinder)
print(cieled_cylinder)
print(floored_cylinder)
'''
#question 4
''''
#GRADES
Grade = (input("enter the grade:"))
if Grade=="A":
print("Excellent")
elif Grade=="B":
print("Good")
elif Grade=="C":
print("Average")
elif Grade=="D":
print("Below Average")
elif Grade=="F":
print("Fail")
print("Better luck next time")
'''
'''
#Question 5
#Even or odd
Number=int(input("Enter the number:"))
if Number%2==0:
print("Even")
else:
print("Odd")
'''
#question 6
#To find wheather the character is vowel or not
'''
character=input("enter the character:")
if character=='a':
print(character,'is vowel')
elif character=='e':
print(character,'is vowel')
elif character=='i':
print(character,'is vowel')
elif character=='o':
print(character,'is vowel')
elif character=='u':
print(character,"is vowel")
elif character=='b' or character=='c' or character=='d' or
character=='e' or character=='f' or character=='g' or
character=='h' or character=='i' or character=='j' or
character=='k' or character=='l' or character=='m' or
character=='n' or character=='o' or character=='p' or
character=='q' or character=='r' or character=='s' or
character=='t' or character=='u' or character=='v' or
character=='w' or character=='x' or character=='y'or
character=='z':
print(character,"is consonant")
'''
#to increment by 2
for counter in range(1,20,2):
print(counter)
'''
1#DAY -2
'''
#TASK 2
#USE FOR LOOP TO OUTPUT FROM 10 TO 0
'''
Countdown_Timer=0
for Countdown_Timer in range(10,-1,-1):
print(Countdown_Timer)
'''
#Task 3
'''
#why 10 is not printed in the below code and -1 is printed
Value=10
while(Value<=10):
Value=Value-1
print(Value)
if(Value==-1):
break
'''
#OR WE CAN USE to simply print from 10 to 0
'''
value=10
while value>=0:
print(value)
value=value-1
'''
#TASK 4 WRITE A PROGRAM TO INPUT NUMBERS
REPEATEDLY UNTIL THE USER ENTERS A POSITIVE
NUMBER
'''
number=int(input("enter the number:"))
while True:
if number<0:
number=int(input("enter the number:"))
else:
break
print("positive number entered")
#or
total=0
n=number
for i in range(1,n+1):
total=total+i
print("The total sum from 1 to", number, "is:", total)
'''
#expression building and printing
number = int(input("Enter the number: "))
# Step 1: Validate input
while number < 0:
number = int(input("Enter a positive number: "))
else:
print("Positive number entered")
# Step 2: Calculate total and build reverse expression like
5+4+3+2+1
total = 0
expression = ""
# datatypes in py
'''
number=10
real=10.2
char='a'
string="Hello"
boolean=True
print(number,real,char,string,boolean)
'''
'''
#QUESTION 1
#calculate the volume of a sphere
'''
radius=float(input("Enter the radius of the circle:"))
sphere_volume=(4/3)*3.14*radius**3 #radius to the power
of 3
print("sphere volume is",sphere_volume)
'''
#Question 2
#calculate the volume of a cylinder
'''
import math
Radius=float(input("enter the radius of the circle:"))
Height=float(input("enter the height of the cylinder:"))
volume_cylinder=3.14*Radius**2*Height
print ("volume of the cylinder is",volume_cylinder)
rounded_cylinder=round(volume_cylinder,2)
print(rounded_cylinder)
cieled_cylinder=[Link](volume_cylinder)
floored_cylinder=[Link](volume_cylinder)
print(cieled_cylinder)
print(floored_cylinder)
'''
#question 4
''''
#GRADES
Grade = (input("enter the grade:"))
if Grade=="A":
print("Excellent")
elif Grade=="B":
print("Good")
elif Grade=="C":
print("Average")
elif Grade=="D":
print("Below Average")
elif Grade=="F":
print("Fail")
print("Better luck next time")
'''
'''
#Question 5
#Even or odd
Number=int(input("Enter the number:"))
if Number%2==0:
print("Even")
else:
print("Odd")
'''
#question 6
#To find wheather the character is vowel or not
'''
character=input("enter the character:")
if character=='a':
print(character,'is vowel')
elif character=='e':
print(character,'is vowel')
elif character=='i':
print(character,'is vowel')
elif character=='o':
print(character,'is vowel')
elif character=='u':
print(character,"is vowel")
elif character=='b' or character=='c' or character=='d' or
character=='e' or character=='f' or character=='g' or
character=='h' or character=='i' or character=='j' or
character=='k' or character=='l' or character=='m' or
character=='n' or character=='o' or character=='p' or
character=='q' or character=='r' or character=='s' or
character=='t' or character=='u' or character=='v' or
character=='w' or character=='x' or character=='y'or
character=='z':
print(character,"is consonant")
'''
#to increment by 2
for counter in range(1,20,2):
print(counter)
'''
1#DAY -2
#Task 3
'''
#why 10 is not printed in the below code and -1 is printed
Value=10
while(Value<=10):
Value=Value-1
print(Value)
if(Value==-1):
break
'''
#OR WE CAN USE to simply print from 10 to 0
'''
value=10
while value>=0:
print(value)
value=value-1
'''
#TASK 4 WRITE A PROGRAM TO INPUT NUMBERS
REPEATEDLY UNTIL THE USER ENTERS A POSITIVE
NUMBER
'''
number=int(input("enter the number:"))
while True:
if number<0:
number=int(input("enter the number:"))
else:
break
print("positive number entered")
#or
total=0
n=number
for i in range(1,n+1):
total=total+i
print("The total sum from 1 to", number, "is:", total)
'''
# datatypes in py
'''
number=10
real=10.2
char='a'
string="Hello"
boolean=True
print(number,real,char,string,boolean)
'''
'''
#QUESTION 1
#calculate the volume of a sphere
'''
radius=float(input("Enter the radius of the circle:"))
sphere_volume=(4/3)*3.14*radius**3 #radius to the power
of 3
print("sphere volume is",sphere_volume)
'''
#Question 2
#calculate the volume of a cylinder
'''
import math
Radius=float(input("enter the radius of the circle:"))
Height=float(input("enter the height of the cylinder:"))
volume_cylinder=3.14*Radius**2*Height
print ("volume of the cylinder is",volume_cylinder)
rounded_cylinder=round(volume_cylinder,2)
print(rounded_cylinder)
cieled_cylinder=[Link](volume_cylinder)
floored_cylinder=[Link](volume_cylinder)
print(cieled_cylinder)
print(floored_cylinder)
'''
#question 4
''''
#GRADES
Grade = (input("enter the grade:"))
if Grade=="A":
print("Excellent")
elif Grade=="B":
print("Good")
elif Grade=="C":
print("Average")
elif Grade=="D":
print("Below Average")
elif Grade=="F":
print("Fail")
print("Better luck next time")
'''
'''
#Question 5
#Even or odd
Number=int(input("Enter the number:"))
if Number%2==0:
print("Even")
else:
print("Odd")
'''
#question 6
#To find wheather the character is vowel or not
'''
character=input("enter the character:")
if character=='a':
print(character,'is vowel')
elif character=='e':
print(character,'is vowel')
elif character=='i':
print(character,'is vowel')
elif character=='o':
print(character,'is vowel')
elif character=='u':
print(character,"is vowel")
elif character=='b' or character=='c' or character=='d' or
character=='e' or character=='f' or character=='g' or
character=='h' or character=='i' or character=='j' or
character=='k' or character=='l' or character=='m' or
character=='n' or character=='o' or character=='p' or
character=='q' or character=='r' or character=='s' or
character=='t' or character=='u' or character=='v' or
character=='w' or character=='x' or character=='y'or
character=='z':
print(character,"is consonant")
'''
#to increment by 2
for counter in range(1,20,2):
print(counter)
'''
1#DAY -2
'''
#TASK 2
#USE FOR LOOP TO OUTPUT FROM 10 TO 0
'''
Countdown_Timer=0
for Countdown_Timer in range(10,-1,-1):
print(Countdown_Timer)
'''
#Task 3
'''
#why 10 is not printed in the below code and -1 is printed
Value=10
while(Value<=10):
Value=Value-1
print(Value)
if(Value==-1):
break
'''
#OR WE CAN USE to simply print from 10 to 0
'''
value=10
while value>=0:
print(value)
value=value-1
'''
#TASK 4 WRITE A PROGRAM TO INPUT NUMBERS
REPEATEDLY UNTIL THE USER ENTERS A POSITIVE
NUMBER
'''
number=int(input("enter the number:"))
while True:
if number<0:
number=int(input("enter the number:"))
else:
break
print("positive number entered")
#or
total=0
n=number
for i in range(1,n+1):
total=total+i
print("The total sum from 1 to", number, "is:", total)
'''
# datatypes in py
'''
number=10
real=10.2
char='a'
string="Hello"
boolean=True
print(number,real,char,string,boolean)
'''
#input and output
'''
name=input("Enter your name:")
age=int(input("Enter your age:"))
print("Hello",name,"you are",age,"years old")
if age>18:
print("You are eligible to vote")
else:
print("You are not eligible to vote")
'''
#QUESTION 1
#calculate the volume of a sphere
'''
radius=float(input("Enter the radius of the circle:"))
sphere_volume=(4/3)*3.14*radius**3 #radius to the power
of 3
print("sphere volume is",sphere_volume)
'''
#Question 2
#calculate the volume of a cylinder
'''
import math
Radius=float(input("enter the radius of the circle:"))
Height=float(input("enter the height of the cylinder:"))
volume_cylinder=3.14*Radius**2*Height
print ("volume of the cylinder is",volume_cylinder)
rounded_cylinder=round(volume_cylinder,2)
print(rounded_cylinder)
cieled_cylinder=[Link](volume_cylinder)
floored_cylinder=[Link](volume_cylinder)
print(cieled_cylinder)
print(floored_cylinder)
'''
#question 4
''''
#GRADES
Grade = (input("enter the grade:"))
if Grade=="A":
print("Excellent")
elif Grade=="B":
print("Good")
elif Grade=="C":
print("Average")
elif Grade=="D":
print("Below Average")
elif Grade=="F":
print("Fail")
print("Better luck next time")
'''
'''
#Question 5
#Even or odd
Number=int(input("Enter the number:"))
if Number%2==0:
print("Even")
else:
print("Odd")
'''
#question 6
#To find wheather the character is vowel or not
'''
character=input("enter the character:")
if character=='a':
print(character,'is vowel')
elif character=='e':
print(character,'is vowel')
elif character=='i':
print(character,'is vowel')
elif character=='o':
print(character,'is vowel')
elif character=='u':
print(character,"is vowel")
elif character=='b' or character=='c' or character=='d' or
character=='e' or character=='f' or character=='g' or
character=='h' or character=='i' or character=='j' or
character=='k' or character=='l' or character=='m' or
character=='n' or character=='o' or character=='p' or
character=='q' or character=='r' or character=='s' or
character=='t' or character=='u' or character=='v' or
character=='w' or character=='x' or character=='y'or
character=='z':
print(character,"is consonant")
'''
#to increment by 2
for counter in range(1,20,2):
print(counter)
'''
1#DAY -2
'''
#TASK 2
#USE FOR LOOP TO OUTPUT FROM 10 TO 0
'''
Countdown_Timer=0
for Countdown_Timer in range(10,-1,-1):
print(Countdown_Timer)
'''
#Task 3
'''
#why 10 is not printed in the below code and -1 is printed
Value=10
while(Value<=10):
Value=Value-1
print(Value)
if(Value==-1):
break
'''
#OR WE CAN USE to simply print from 10 to 0
'''
value=10
while value>=0:
print(value)
value=value-1
'''
#TASK 4 WRITE A PROGRAM TO INPUT NUMBERS
REPEATEDLY UNTIL THE USER ENTERS A POSITIVE
NUMBER
'''
number=int(input("enter the number:"))
while True:
if number<0:
number=int(input("enter the number:"))
else:
break
print("positive number entered")
#or
total=0
n=number
for i in range(1,n+1):
total=total+i
print("The total sum from 1 to", number, "is:", total)
'''
# datatypes in py
'''
number=10
real=10.2
char='a'
string="Hello"
boolean=True
print(number,real,char,string,boolean)
'''
'''
#QUESTION 1
#calculate the volume of a sphere
'''
radius=float(input("Enter the radius of the circle:"))
sphere_volume=(4/3)*3.14*radius**3 #radius to the power
of 3
print("sphere volume is",sphere_volume)
'''
#Question 2
#calculate the volume of a cylinder
'''
import math
Radius=float(input("enter the radius of the circle:"))
Height=float(input("enter the height of the cylinder:"))
volume_cylinder=3.14*Radius**2*Height
print ("volume of the cylinder is",volume_cylinder)
rounded_cylinder=round(volume_cylinder,2)
print(rounded_cylinder)
cieled_cylinder=[Link](volume_cylinder)
floored_cylinder=[Link](volume_cylinder)
print(cieled_cylinder)
print(floored_cylinder)
'''
#question 4
''''
#GRADES
Grade = (input("enter the grade:"))
if Grade=="A":
print("Excellent")
elif Grade=="B":
print("Good")
elif Grade=="C":
print("Average")
elif Grade=="D":
print("Below Average")
elif Grade=="F":
print("Fail")
print("Better luck next time")
'''
'''
#Question 5
#Even or odd
Number=int(input("Enter the number:"))
if Number%2==0:
print("Even")
else:
print("Odd")
'''
#question 6
#To find wheather the character is vowel or not
'''
character=input("enter the character:")
if character=='a':
print(character,'is vowel')
elif character=='e':
print(character,'is vowel')
elif character=='i':
print(character,'is vowel')
elif character=='o':
print(character,'is vowel')
elif character=='u':
print(character,"is vowel")
elif character=='b' or character=='c' or character=='d' or
character=='e' or character=='f' or character=='g' or
character=='h' or character=='i' or character=='j' or
character=='k' or character=='l' or character=='m' or
character=='n' or character=='o' or character=='p' or
character=='q' or character=='r' or character=='s' or
character=='t' or character=='u' or character=='v' or
character=='w' or character=='x' or character=='y'or
character=='z':
print(character,"is consonant")
'''
#to increment by 2
for counter in range(1,20,2):
print(counter)
'''
1#DAY -2
'''
#TASK 2
#USE FOR LOOP TO OUTPUT FROM 10 TO 0
'''
Countdown_Timer=0
for Countdown_Timer in range(10,-1,-1):
print(Countdown_Timer)
'''
#Task 3
'''
#why 10 is not printed in the below code and -1 is printed
Value=10
while(Value<=10):
Value=Value-1
print(Value)
if(Value==-1):
break
'''
#OR WE CAN USE to simply print from 10 to 0
'''
value=10
while value>=0:
print(value)
value=value-1
'''
#TASK 4 WRITE A PROGRAM TO INPUT NUMBERS
REPEATEDLY UNTIL THE USER ENTERS A POSITIVE
NUMBER
'''
number=int(input("enter the number:"))
while True:
if number<0:
number=int(input("enter the number:"))
else:
break
print("positive number entered")
#or
number=int(input("enter the number:"))
while number<0:
number=int(input("enter the number:"))
print("positive number entered")
'''
#TASK 5 SUM TO N
# datatypes in py
'''
number=10
real=10.2
char='a'
string="Hello"
boolean=True
print(number,real,char,string,boolean)
'''
'''
#QUESTION 1
#calculate the volume of a sphere
'''
radius=float(input("Enter the radius of the circle:"))
sphere_volume=(4/3)*3.14*radius**3 #radius to the power
of 3
print("sphere volume is",sphere_volume)
'''
#Question 2
#calculate the volume of a cylinder
'''
import math
Radius=float(input("enter the radius of the circle:"))
Height=float(input("enter the height of the cylinder:"))
volume_cylinder=3.14*Radius**2*Height
print ("volume of the cylinder is",volume_cylinder)
rounded_cylinder=round(volume_cylinder,2)
print(rounded_cylinder)
cieled_cylinder=[Link](volume_cylinder)
floored_cylinder=[Link](volume_cylinder)
print(cieled_cylinder)
print(floored_cylinder)
'''
#question 4
''''
#GRADES
Grade = (input("enter the grade:"))
if Grade=="A":
print("Excellent")
elif Grade=="B":
print("Good")
elif Grade=="C":
print("Average")
elif Grade=="D":
print("Below Average")
elif Grade=="F":
print("Fail")
print("Better luck next time")
'''
'''
#Question 5
#Even or odd
Number=int(input("Enter the number:"))
if Number%2==0:
print("Even")
else:
print("Odd")
'''
#question 6
#To find wheather the character is vowel or not
'''
character=input("enter the character:")
if character=='a':
print(character,'is vowel')
elif character=='e':
print(character,'is vowel')
elif character=='i':
print(character,'is vowel')
elif character=='o':
print(character,'is vowel')
elif character=='u':
print(character,"is vowel")
elif character=='b' or character=='c' or character=='d' or
character=='e' or character=='f' or character=='g' or
character=='h' or character=='i' or character=='j' or
character=='k' or character=='l' or character=='m' or
character=='n' or character=='o' or character=='p' or
character=='q' or character=='r' or character=='s' or
character=='t' or character=='u' or character=='v' or
character=='w' or character=='x' or character=='y'or
character=='z':
print(character,"is consonant")
'''
#to increment by 2
for counter in range(1,20,2):
print(counter)
'''
1#DAY -2
'''
#TASK 2
#USE FOR LOOP TO OUTPUT FROM 10 TO 0
'''
Countdown_Timer=0
for Countdown_Timer in range(10,-1,-1):
print(Countdown_Timer)
'''
#Task 3
Value=10
while(Value<=10):
Value=Value-1
print(Value)
if(Value==-1):
break
'''
#OR WE CAN USE to simply print from 10 to 0
'''
value=10
while value>=0:
print(value)
value=value-1
'''
#TASK 4 WRITE A PROGRAM TO INPUT NUMBERS
REPEATEDLY UNTIL THE USER ENTERS A POSITIVE
NUMBER
'''
number=int(input("enter the number:"))
while True:
if number<0:
number=int(input("enter the number:"))
else:
break
print("positive number entered")
#or
total=0
n=number
for i in range(1,n+1):
total=total+i
print("The total sum from 1 to", number, "is:", total)
'''
# datatypes in py
'''
number=10
real=10.2
char='a'
string="Hello"
boolean=True
print(number,real,char,string,boolean)
'''
'''
#QUESTION 1
#calculate the volume of a sphere
'''
radius=float(input("Enter the radius of the circle:"))
sphere_volume=(4/3)*3.14*radius**3 #radius to the power
of 3
print("sphere volume is",sphere_volume)
'''
#Question 2
#calculate the volume of a cylinder
'''
import math
Radius=float(input("enter the radius of the circle:"))
Height=float(input("enter the height of the cylinder:"))
volume_cylinder=3.14*Radius**2*Height
print ("volume of the cylinder is",volume_cylinder)
rounded_cylinder=round(volume_cylinder,2)
print(rounded_cylinder)
cieled_cylinder=[Link](volume_cylinder)
floored_cylinder=[Link](volume_cylinder)
print(cieled_cylinder)
print(floored_cylinder)
'''
#question 4
''''
#GRADES
Grade = (input("enter the grade:"))
if Grade=="A":
print("Excellent")
elif Grade=="B":
print("Good")
elif Grade=="C":
print("Average")
elif Grade=="D":
print("Below Average")
elif Grade=="F":
print("Fail")
print("Better luck next time")
'''
'''
#Question 5
#Even or odd
Number=int(input("Enter the number:"))
if Number%2==0:
print("Even")
else:
print("Odd")
'''
#question 6
#To find wheather the character is vowel or not
'''
character=input("enter the character:")
if character=='a':
print(character,'is vowel')
elif character=='e':
print(character,'is vowel')
elif character=='i':
print(character,'is vowel')
elif character=='o':
print(character,'is vowel')
elif character=='u':
print(character,"is vowel")
elif character=='b' or character=='c' or character=='d' or
character=='e' or character=='f' or character=='g' or
character=='h' or character=='i' or character=='j' or
character=='k' or character=='l' or character=='m' or
character=='n' or character=='o' or character=='p' or
character=='q' or character=='r' or character=='s' or
character=='t' or character=='u' or character=='v' or
character=='w' or character=='x' or character=='y'or
character=='z':
print(character,"is consonant")
'''
#to increment by 2
for counter in range(1,20,2):
print(counter)
'''
#PRECONDITION LOOP -CONDTION MUST BE TRUE
BEFORE THE LOOP STARTS
#(while loop-number of loops is not known or predecided)
'''
Total=0
print("Enter the numbers to be added until -1 to finish:")
Mark=int(input("Enter the number:"))
while Mark!=-1: #condtion must be met before the
indented code is executed
Total=Total+Mark
Mark=int(input("Enter the number:"))
print("Total is",Total)
'''
1#DAY -2
'''
#TASK 2
#USE FOR LOOP TO OUTPUT FROM 10 TO 0
'''
Countdown_Timer=0
for Countdown_Timer in range(10,-1,-1):
print(Countdown_Timer)
'''
#Task 3
'''
#why 10 is not printed in the below code and -1 is printed
Value=10
while(Value<=10):
Value=Value-1
print(Value)
if(Value==-1):
break
'''
#OR WE CAN USE to simply print from 10 to 0
'''
value=10
while value>=0:
print(value)
value=value-1
'''
#TASK 4 WRITE A PROGRAM TO INPUT NUMBERS
REPEATEDLY UNTIL THE USER ENTERS A POSITIVE
NUMBER
'''
number=int(input("enter the number:"))
while True:
if number<0:
number=int(input("enter the number:"))
else:
break
print("positive number entered")
#or
total=0
n=number
for i in range(1,n+1):
total=total+i
print("The total sum from 1 to", number, "is:", total)
'''