# Find the average of a three numbers
def average(a,b,c):
d=(a+b+c)/3
print("average of three no=",d)
a=int(input("enter the value of a="))
b=int(input("enter the value of b="))
c=int(input("enter the value of c="))
average(a,b,c)
#multiplication of two numbers
a=int(input("enter first number"))
b=int(input("enter second number"))
multiplication_of_two_numbers=a*b
print("multiplication of two numbers",a*b)
#find the area of triangle
base=int(input("Enter the base of triangle"))
hight=int(input("Enter the hight of triangle"))
area_of_triangle=0.5*base*hight
print("the area of triangle is",area_of_triangle)
#program to count the no. of digit in a number
num=38521
count=0
while num !=0:
num=num//10
count=count+1
print("the no. of digits in are", count)
# Reverse programs in python
mystring="hello everyone this is python class"
words=mystring.split()
words.sort(reverse=True)
print(words)
mystring=input("enter the words")
words=mystring.split()
words.sort(reverse=True)
print(words)
#programs various operatous on list
new_list=["mango","apple","grapes"]
new_list.insert(1,"orange")
print(new_list)
new_list.append("pineapple")
print(new_list)
new_list.remove("pineapple")
print(new_list)
new_list.pop("2")
#programs various operatous on list to insert
new_list=["mango","apple","grapes"]
new_list.insert(1,"orange")
print(new_list)
new_list.append("pineapple")
print(new_list)
new_list.remove("pineapple")
print(new_list)
new_list.pop("2")
#fibbonacci series
n1,n2=0,1
count=0
while count <=10:
print(n1)
nth=n1+n2
n1=n2
n2=nth
count=count+1
#for loop in fibonacci series
a=0
b=1
print(a)
print(b)
for i in range(1,10):
c=a+b
print(c)
a=b
b=c
# user input
a=int(input("enter first number"))
n1,n2=0,1
count=0
while count <=10:
print(n1)
print("fibbonacci series")
nth=n1=n2
n1=n2
n2=nth
count=count+1
#def simple_intrest(p,r,t):
amount=(p*r*t)/100
print("simple intrest=",amount)
p=float(input("enter the principle value="))
r=float(input("enter the rate intrest value="))
t=float(input("enter the time value="))
t1=t*21
simple_intrest(p,r,t)
#Display a word sorted in alphabetical order
name=input("enter ypur name")
print("enter string name:")
print("sorted list is:")
name=sorted(name,reverse=True)
print(name)
#python list
list=['prakash',3154,2.23,'tiwari',70.2]
tinylist=[123,'tiwari',70.2]
#print complete list
print(list)
#print first element of the list
print([0])
#prints elements starting from 2nd till 3rd
print(list[1:3])
#print elements starting from 3rd element
print(list[2:])
#print list two times
print(tinylist *2)
#prints concatend lists
print(list+tinylist)
# work in python tuple
tuple=('prakash',2003552,5.45,"tiwari",)
tinytuple=(3105,"pra")
#prints the complete tuple
print(tuple)
#prints first element of the tuple
print(tuple[0])
#print elements of the starting from 2nd till 3rd
print(tuple[1:3])
#prints element starting from 3rd element
print(tuple[2:])
#prints list two times
print(tinytuple*2)
#prints conacted lists
print(tuple+tinytuple)
#pyhon dictionary
dict={ }
dict['one']="this is one"
dict[2]="this is two"
tinydict={'name':'Prakash','code':3105,'dept':'trading'}
#prints value for 'one' key
print(dict['one'])
#prints value for 2 key
print(dict[2])
#prints complete dictionary
print(tinydict)
#prints all the key
print(tinydict.keys())
#print all the value
print(tinydict.values())