diff --git a/1.py b/1.py new file mode 100644 index 0000000..6db9202 --- /dev/null +++ b/1.py @@ -0,0 +1,32 @@ +from tkinter import* +from tkinter import filedialog +import pyttsx3 +import PyPDF2 +Window=Tk() +Window.geometry('500x350') +Window.config(bg="orange") +Window.title("Convert PDF File Text to Audio Speech Using Python by Our Team") +startingpagenumber = Entry(Window) +page1.place(relx=0.02,rely=0.1) +startingpagenumber.place(relx=0.6,rely=0.1) +page1=Label(Window,text=1) +label = Label(Window, text="select a book.") +label.place(relx=0.3,rely=0.2) + +def file(): + path = filedialog.askopenfilename() + book = open(path, 'rb') + pdfreader = PyPDF2.PdfFileReader(book) + pages = pdfreader.numPages + speaker = pyttsx3.init() + + for i in range(int(startingpagenumber.get()), pages): + page = pdfreader.getPage(i) + txt = page.extractText() + speaker.say(txt) + speaker.runAndWait() + +B=Button(Window, text="Choose the Book", command=file) +B.place(relx=0.4,rely=0.3) + +mainloop() \ No newline at end of file diff --git a/PYTHON PROGRAMS.docx b/PYTHON PROGRAMS.docx new file mode 100644 index 0000000..33b517c Binary files /dev/null and b/PYTHON PROGRAMS.docx differ diff --git a/Total number of notes in amount.py b/Total number of notes in amount.py new file mode 100644 index 0000000..fc8e3e8 --- /dev/null +++ b/Total number of notes in amount.py @@ -0,0 +1,46 @@ +a=int(input("Enter the amount : ")) +n2000=n500=n200=n100=n50=n20=n10=n5=n2=n1=0 +if(a>=2000): + n2000=a//2000 + a=a-n2000*2000 +if(a>=500): + n500=a//500 + a=a-n500*500 +if(a>=200): + n200=a//200 + a=a-n200*200 +if(a>=100): + n100=a//100 + a=a-n100*100 +if(a>=50): + n50=a//50 + a=a-n50*50 +if(a>=20): + n20=a//20 + a=a-n20*20 +if(a>=10): + n10=a//10 + a=a-n10*10 +if(a>=5): + n5=a//5 + a=a-n5*5 +if(a>=2): + n2=a//2 + a=a-n2*2 +if(a>=1): + n1=a//1 + a=a-n1*1 +print("Noes of 2000 = ",n2000) +print("Noes of 500 = ",n500) +print("Noes of 200 = ",n200) +print("Noes of 100 = ",n100) +print("Noes of 50 = ",n50) +print("Noes of 20 = ",n20) +print("Noes of 10 = ",n10) +print("Noes of 5 = ",n5) +print("Noes of 2 = ",n2) +print("Noes of 1 = ",n1) + + + + diff --git a/area_of_scalen_triangle.py b/area_of_scalen_triangle.py new file mode 100644 index 0000000..4aaa9c1 --- /dev/null +++ b/area_of_scalen_triangle.py @@ -0,0 +1,9 @@ +# write a program to find the area of the triangle +# by using heron's formula +a1=int(input("Enter the side 1 : ")) +a3=int(input("Enter the side 3 : ")) +a2=int(input("Enter the side 2 : ")) +# first we find semi parimeter +s=(a1+a2+a3)/2 +area=(s*(s-a1)*(s-a2)*(s-a3))**0.5 +print("Area of the scalen triangle is %d unit^2"%area) \ No newline at end of file diff --git a/avg.py b/avg.py new file mode 100644 index 0000000..71dd42c --- /dev/null +++ b/avg.py @@ -0,0 +1,7 @@ +a=85 +b=68 +c=59 +d=78 +e=(82*500/100)-(a+b+c+d) +print(e) + diff --git a/body mass.py b/body mass.py new file mode 100644 index 0000000..40935e2 --- /dev/null +++ b/body mass.py @@ -0,0 +1,5 @@ +# write a program to find BMII(body mass index) ? +h=int(input("Enter your height in meter :")) +w=int(input("Enter your weight in kg :")) +bmi=w/(h**2) +print("Your body mass is",bmi) \ No newline at end of file diff --git a/cal.py b/cal.py new file mode 100644 index 0000000..17e26c0 --- /dev/null +++ b/cal.py @@ -0,0 +1,5 @@ +a=input("enter a string") +b=input("enter 2 string") +c=a+b +print(c) + diff --git a/calender.py b/calender.py new file mode 100644 index 0000000..c3d0298 --- /dev/null +++ b/calender.py @@ -0,0 +1,3 @@ +from calendar import* +year=int(input("Enter year:")) +print(calendar(year)) \ No newline at end of file diff --git a/check even_odd_using_lambda.py b/check even_odd_using_lambda.py new file mode 100644 index 0000000..d1f5846 --- /dev/null +++ b/check even_odd_using_lambda.py @@ -0,0 +1,7 @@ +f=lambda a:True if a%2==0 else False +n=int(input("Enter the number to check :")) +b=f(n) +if(b==True): + print("It is even number") +else: + print("Not even") \ No newline at end of file diff --git a/check last digit binary.py b/check last digit binary.py new file mode 100644 index 0000000..85872b6 --- /dev/null +++ b/check last digit binary.py @@ -0,0 +1,5 @@ +# write a python program to check wether last digit is binary or not +a=int(input("Enter the number that you want to check : ")) +n=a%10 +b=n&1 +print("Last binary digit is ",b) \ No newline at end of file diff --git a/convert list item in upperrcase.py b/convert list item in upperrcase.py new file mode 100644 index 0000000..147b433 --- /dev/null +++ b/convert list item in upperrcase.py @@ -0,0 +1,6 @@ +# sample input=['kanishk', 'ritik', 'rahul', 'govind', 'dev'] +# sample output+=['KANISHK', 'RITIK', 'RAHUL', 'GOVIND', 'DEV'] +a=input("Enter string with space:").split() +print(a) +lst=list(map(lambda x:x.upper(), a)) +print(lst) \ No newline at end of file diff --git a/cricket.py b/cricket.py new file mode 100644 index 0000000..3b2bdca --- /dev/null +++ b/cricket.py @@ -0,0 +1,3 @@ +o=int(input("Enter the number of overs :")) +run=(o-1)*33+36 +print("Total run score by player in %d overs is %d"%(o,run)) \ No newline at end of file diff --git a/currency_notes.py b/currency_notes.py new file mode 100644 index 0000000..e41c033 --- /dev/null +++ b/currency_notes.py @@ -0,0 +1,13 @@ +a=int(input("Enter the money to be withdrawn : ")) +ahundred=1 +a=a-100 +twothousand=a//2000 +rem=a%2000 +fivehundred=rem//500 +r=rem%500 +hundred=r//100 + + +print("Number of 2000 notes : ",twothousand) +print("Number of 500 notes : ",fivehundred) +print("Number of hundred notes : ",ahundred+hundred) \ No newline at end of file diff --git a/distance between two co-ordinate.py b/distance between two co-ordinate.py new file mode 100644 index 0000000..bd7ba71 --- /dev/null +++ b/distance between two co-ordinate.py @@ -0,0 +1,7 @@ +# write a program to find the distance between two co-ordinate +a1=int(input("Enter a1 : ")) +a2=int(input("Enter a2 : ")) +b1=int(input("Enter b1 : ")) +b2=int(input("Enter b2 : ")) +d=(((a2-a1)**2)+((b2-b1)**2))**0.5 +print("Distance between two points is ",d) diff --git a/distance.py b/distance.py new file mode 100644 index 0000000..43bc2c6 --- /dev/null +++ b/distance.py @@ -0,0 +1,3 @@ +d=int(input("Enter distance in meters :")) +d=d//1000 +print("Distance in kilometers is ",d) \ No newline at end of file diff --git a/even numbers in list.py b/even numbers in list.py new file mode 100644 index 0000000..3abc999 --- /dev/null +++ b/even numbers in list.py @@ -0,0 +1,6 @@ +lst=[10,20,23,24,25,26] +a=list(filter(lambda x:(x%2==0),lst)) +print(a) + + + diff --git a/fabonacci_fun.py b/fabonacci_fun.py new file mode 100644 index 0000000..fda770d --- /dev/null +++ b/fabonacci_fun.py @@ -0,0 +1,7 @@ +def fun(x): + a,b=0,1 + for i in range(x): + print(a) + a,b=b,a+b +n=int(input("Enter the number of terms :")) +fun(n) \ No newline at end of file diff --git a/fabonaci.py b/fabonaci.py new file mode 100644 index 0000000..6546e1c --- /dev/null +++ b/fabonaci.py @@ -0,0 +1,9 @@ +l=int(input("Enter the number of terms:")) + +y=lambda x,y:x+y + +a,b=0,1 +for i in range (l): + c=y(a,b) + print(a,end=" ") + a,b=b,c \ No newline at end of file diff --git a/field project.py b/field project.py new file mode 100644 index 0000000..3a4e325 --- /dev/null +++ b/field project.py @@ -0,0 +1,23 @@ +# importing the modules +from http.cookies import BaseCookie +import PyPDF2 +import pyttsx3 + +# path of the PDF file +path = open('C:\\Users\\kanis\\OneDrive\\Desktop\\Fitting Shop.pdf', 'rb') + +# creating a PdfFileReader object +pdfReader = PyPDF2.PdfFileReader(path) + +# the page with which you want to start +# this will read the page of 25th page. +from_page = pdfReader.getPage(1) + +# extracting the text from the PDF +text = from_page.extractText() + + +# reading the text +speak = pyttsx3.init() +speak.say(text) +speak.runAndWait() diff --git a/filter even.py b/filter even.py new file mode 100644 index 0000000..fc67b22 --- /dev/null +++ b/filter even.py @@ -0,0 +1,8 @@ +def even(n): + if(n%2==0): + return True + else: + return False +lst=[2,3,4,5,6,7,8] +a=list(filter((even),lst)) +print(a) \ No newline at end of file diff --git a/filter positive from list.py b/filter positive from list.py new file mode 100644 index 0000000..89c5157 --- /dev/null +++ b/filter positive from list.py @@ -0,0 +1,16 @@ +lst=list(map(int,input("Enter the element of list with a space").split())) +print(lst) + +#by using lambda +# lst2=list(filter(lambda x:x>0 ,lst)) +#print(lst2) + +#without using lambda +def abc(a): + if(a>0): + return True + else: + return False + +lst2=list(filter(abc,lst)) +print(lst2) \ No newline at end of file diff --git a/find factorial.py b/find factorial.py new file mode 100644 index 0000000..4282c6f --- /dev/null +++ b/find factorial.py @@ -0,0 +1,7 @@ +def fact(a): + fact=1 + for i in range(a,0,-1): + fact*=i + return fact +n=int(input("Enter the number to find factorial")) +print("factorial is ",fact(n)) diff --git a/find maximum of three nmumbers.py b/find maximum of three nmumbers.py new file mode 100644 index 0000000..26be246 --- /dev/null +++ b/find maximum of three nmumbers.py @@ -0,0 +1,11 @@ +def num(a,b,c): + if((a>b) and (a>c)): + return(a) + elif((b>c) and (b>a)): + return(b) + else: + return(c) +a1=int(input("Enter 1 no:")) +a2=int(input("Enter 2 no:")) +a3=int(input("Enter 3 no:")) +print("maxim no is",num(a1,a2,a3)) diff --git a/find_palindromme.py b/find_palindromme.py new file mode 100644 index 0000000..3ddebb0 --- /dev/null +++ b/find_palindromme.py @@ -0,0 +1,3 @@ +lst=['php','w3r','mom','sas','ass'] +a=list(filter(lambda x: x==x[-1: :-1],lst)) +print(a) \ No newline at end of file diff --git a/generators.py b/generators.py new file mode 100644 index 0000000..51efd68 --- /dev/null +++ b/generators.py @@ -0,0 +1,11 @@ +def mygen(x,y): + while(x= 'A' and n<='Z') or (n>='a' and n<='z'): + print(n," is a character ") +else: + print(n," is not character : ") \ No newline at end of file diff --git a/import module_own.py b/import module_own.py new file mode 100644 index 0000000..59f4eff --- /dev/null +++ b/import module_own.py @@ -0,0 +1,8 @@ +# type 1 +import reversed_words +a=input("Enter the word to reverse") +print(reversed_words.reverse(a)) +# type 2 +'''from reversed_words import* +a=input("Enter the sentence:") +print(reverse(a))''' \ No newline at end of file diff --git a/lambda function to find the bigger.py b/lambda function to find the bigger.py new file mode 100644 index 0000000..d9a01a1 --- /dev/null +++ b/lambda function to find the bigger.py @@ -0,0 +1,4 @@ +a=lambda x,y:x if (x>y) else y +a1=int(input("Enter no1:")) +a2=int(input("Enter no2:")) +print("max is ",a(a1,a2)) \ No newline at end of file diff --git a/multiply with 32.py b/multiply with 32.py new file mode 100644 index 0000000..41a8674 --- /dev/null +++ b/multiply with 32.py @@ -0,0 +1,4 @@ +# write a program to multiply a number by 32 +a=int(input("Enter the number that you want to multiply: ")) +mult=a<<5 +print("%d multiply by %d is %d"%(a,32,mult)) \ No newline at end of file diff --git a/multiply with 33.py b/multiply with 33.py new file mode 100644 index 0000000..4b446d0 --- /dev/null +++ b/multiply with 33.py @@ -0,0 +1,5 @@ +# write a program to multiply a number by 33 +a=int(input("Enter the number that you want to multiply: ")) +b=a<<5 +mult=a+b +print("%d multiply by %d is %d"%(a,33,mult)) \ No newline at end of file diff --git a/name space_unlimited.py b/name space_unlimited.py new file mode 100644 index 0000000..dad0b53 --- /dev/null +++ b/name space_unlimited.py @@ -0,0 +1,20 @@ +def name(n): + sum=0 + n=" "+n + for i in range(len(n)): + if(n[i]==" "): + sum+=1 + print(sum) + temp=0 + for i in range(len(n)): + if((n[i]==" ") and temp!=(sum-1)): + a=n[i+1] + print(a,end=""+" ") + temp+=1 + elif((n[i]==" ") and temp==(sum-1)): + b=n[i:len(n)] + temp+=1 + print(b,end="") + +a=input("Enter the name :") +name(a) \ No newline at end of file diff --git a/name_space.py b/name_space.py new file mode 100644 index 0000000..c3631c3 --- /dev/null +++ b/name_space.py @@ -0,0 +1,8 @@ +def name(a): + for i in range(len(a)): + if(a[i]==' '): + n=a[i:] + print(a[0]+' '+n) + +a=input("Enter your name:") +name(a) \ No newline at end of file diff --git a/neon.py b/neon.py new file mode 100644 index 0000000..9c868ef --- /dev/null +++ b/neon.py @@ -0,0 +1,15 @@ +def neon(n): + sq=n**2 + sum=0 + while(sq!=0): + sumsq=sq%10 + sum+=sumsq + sq=sq//10 + if(sum==n): + print("number",n,"is neon number") + else: + print("number is not neon") + + +n=int(input("Enter any number : ")) +neon(n) \ No newline at end of file diff --git a/palindrome_string.py b/palindrome_string.py new file mode 100644 index 0000000..4aac06d --- /dev/null +++ b/palindrome_string.py @@ -0,0 +1,9 @@ +def fun(x): + a=x[-1: :-1] + if(a==x): + print("String is palindrome") + else: + print("String is not palindrome") + +n=input("Input the string :") +fun(n) \ No newline at end of file diff --git a/perfect no function.py b/perfect no function.py new file mode 100644 index 0000000..5656d7e --- /dev/null +++ b/perfect no function.py @@ -0,0 +1,12 @@ +def per(n): + suma=0 + for i in range(1,n): + if(n%i==0): + suma+=i + if(suma==n): + print("No is perfect:") + else: + print("No is not perfect :") +x=int(input("Enter the number that you want to check")) +per(x) + diff --git a/print_multiplication_table.py b/print_multiplication_table.py new file mode 100644 index 0000000..861360b --- /dev/null +++ b/print_multiplication_table.py @@ -0,0 +1,7 @@ +from tkinter import Y + + +n=int(input("Enter the number")) +l=lambda x,y:(x*y) +for i in range(1,11): + print(l(n,i)) \ No newline at end of file diff --git a/rabit.py b/rabit.py new file mode 100644 index 0000000..2856c23 --- /dev/null +++ b/rabit.py @@ -0,0 +1,7 @@ +#write a program to find the number of rabits and cock given the number of head and number of leg +head=int(input("Enter the total no of head : ")) +leg=int(input("Enter the total no of legs : ")) +rabbit=(leg//2-head) +cock=2*head-(leg//2) +print("no of rabbit : ",rabbit) +print("Total no of cock : ",cock) \ No newline at end of file diff --git a/rectangular_tiles.py b/rectangular_tiles.py new file mode 100644 index 0000000..43586e3 --- /dev/null +++ b/rectangular_tiles.py @@ -0,0 +1,8 @@ +len1=int(input("Enter the length of the floor in cm : ")) +br1=int(input("Enter the breadth of the floorin cm : ")) +len2=int(input("Enter the length of the tilesin cm : ")) +br2=int(input("Enter the breadth of the tilesin cm : ")) +a1=len1*br1 +a2=len2*br2 +n=a1/a2 +print("No of tiles required ",n) \ No newline at end of file diff --git a/recursion.py b/recursion.py new file mode 100644 index 0000000..1e7d5ee --- /dev/null +++ b/recursion.py @@ -0,0 +1,19 @@ +'''i=0 +def name(): + global i # to take global value to know how many times this code will execute + i+=1 + print("kanishk",i) # this wil print around 1000 times name + name() + +name() ''' + +import sys +sys.setrecursionlimit(2000) # now this will print 2000 times after that it will give error +i=0 +def name(): + global i # to take global value to know how many times this code will execute + i+=1 + print("kanishk",i) # this wil print around 2000 times name + name() + +name() \ No newline at end of file diff --git a/reduce_lambda.py b/reduce_lambda.py new file mode 100644 index 0000000..5b508a9 --- /dev/null +++ b/reduce_lambda.py @@ -0,0 +1,3 @@ +a=[1,2,3,4] +b=list(map(lambda x:x*x ,a)) +print(b) \ No newline at end of file diff --git a/remove _specified_words.py b/remove _specified_words.py new file mode 100644 index 0000000..a53d340 --- /dev/null +++ b/remove _specified_words.py @@ -0,0 +1,4 @@ +a=["red","orange","yellow","green","white","black"] +b=["red","yellow"] #remove these words from list a +y=list(filter(lambda a:a not in b ,a)) +print(y) \ No newline at end of file diff --git a/return square of element in list using lambda.py b/return square of element in list using lambda.py new file mode 100644 index 0000000..61668f9 --- /dev/null +++ b/return square of element in list using lambda.py @@ -0,0 +1,3 @@ +lst=[2,2,3,4] +a=list(map(lambda x:x*x,lst)) +print(a) \ No newline at end of file diff --git a/return square of element in list.py b/return square of element in list.py new file mode 100644 index 0000000..34732c5 --- /dev/null +++ b/return square of element in list.py @@ -0,0 +1,5 @@ +def square(a): + return a*a +lst=[1,2,3,4,5] +a=list(map((square),lst)) +print(a) \ No newline at end of file diff --git a/return unique list elements.py b/return unique list elements.py new file mode 100644 index 0000000..dc7feda --- /dev/null +++ b/return unique list elements.py @@ -0,0 +1,14 @@ +# unique list means remove duplicate elements from the list +def lst(a): + b=[] + for i in a: + if(i not in b): + b.append(i) + return(b) + +n=int(input("Enter the number of elements:")) +b=[] +for i in range(n): + n=int(input("Enter the value:")) + b.append(n) +print("unique list is ",lst(b)) diff --git a/return_multiple.py b/return_multiple.py new file mode 100644 index 0000000..ffa5eb2 --- /dev/null +++ b/return_multiple.py @@ -0,0 +1,13 @@ +def multiple(a,b): + c=a+b + d=a-b + e=a*b + f=a//b + return c,d,e,f +x=int(input("Enter first no:")) +y=int(input("Enter the second no:")) +n,n1,n2,n3=multiple(x,y) +print(n) +print(n1) +print(n2) +print(n3) diff --git a/reverse 3 digit number.py b/reverse 3 digit number.py new file mode 100644 index 0000000..bf015d0 --- /dev/null +++ b/reverse 3 digit number.py @@ -0,0 +1,15 @@ +number=int(input("enter the number")) +a=number//100 +b=number%100 +c=b//10 +d=b%10 +print(d*100+c*10+a) + +# 2nd method +n=int(input("enter the number")) +a=n%10 +n=n//10 +b=n%10 +n=n//10 +c=n%10 +print("number in reverse is %d%d%d"%(a,b,c)) \ No newline at end of file diff --git a/reverse.py b/reverse.py new file mode 100644 index 0000000..0d51cfc --- /dev/null +++ b/reverse.py @@ -0,0 +1,15 @@ +def fun(x): + a=str(x) + rem=0 + rev=0 + sum=0 + for i in range(len(a)): + rem=x%10 + sum+=rem + rev=rev*10+rem + x=x//10 + print(rev) + print("sum of its digit is",sum) + +n=int(input("Enter the number to reverse :")) +fun(n) \ No newline at end of file diff --git a/reversed_words.py b/reversed_words.py new file mode 100644 index 0000000..03a4491 --- /dev/null +++ b/reversed_words.py @@ -0,0 +1,10 @@ +def reverse(x): + a=x.split(" ") + b=" ".join(reversed(a)) + return(b) + + +if __name__=='_main_': + n=input("Enter the words to be reversed: ") + print(reverse(n)) + diff --git a/root.py b/root.py new file mode 100644 index 0000000..86235fe --- /dev/null +++ b/root.py @@ -0,0 +1,7 @@ +a=int(input("enter value")) +b=int(input("enter value")) +c=int(input("enter value")) +d=b-(4*a*c) +root=(b*(d**1/2))/2*a +print(root) + diff --git a/simple intrest and compound intrest.py b/simple intrest and compound intrest.py new file mode 100644 index 0000000..4bb44c2 --- /dev/null +++ b/simple intrest and compound intrest.py @@ -0,0 +1,7 @@ +principal=int(input("Enter the principal amount in rs : ")) +rate=int(input("Enter the rate : ")) +time=int(input("Enter the time : ")) +si=(principal*rate*time)/100 +ci=principal*((1+rate/100)**time)-principal +print("Simple Intrest is",si) +print("Compound Intrest is",ci) diff --git a/student_grade.py b/student_grade.py new file mode 100644 index 0000000..a6af45b --- /dev/null +++ b/student_grade.py @@ -0,0 +1,19 @@ +n1=int(input("Enter the number of subject physics : ")) +n2=int(input("Enter the number of subject chemistry : ")) +n3=int(input("Enter the number of subject math : ")) +n4=int(input("Enter the number of subject Biology : ")) +n5=int(input("Enter the number of subject Computer : ")) +a=(n1+n2+n3+n4+n5)//5 +print("Percentage is ",a) +if(a>=90): + print("your grade is A") +elif(a>=80): + print("Your grade is B") +elif(a>=70): + print("Your grade is C") +elif(a>=60): + print("Your grade is D") +elif(a>=840): + print("Your grade is D") +elif(a<40): + print("your grade is F") diff --git a/sum of all elements of list.py b/sum of all elements of list.py new file mode 100644 index 0000000..8c4d2a7 --- /dev/null +++ b/sum of all elements of list.py @@ -0,0 +1,11 @@ +def lst(a): + sum=0 + for i in a : + sum+=i + return(sum) +n=int(input("Enter the number of elements:")) +b=[] +for i in range(n): + n=int(input("Enter the value:")) + b.append(n) +print("sum of all elements of this list is",lst(b)) \ No newline at end of file diff --git a/sum of last 3 digit.py b/sum of last 3 digit.py new file mode 100644 index 0000000..43fafb9 --- /dev/null +++ b/sum of last 3 digit.py @@ -0,0 +1,9 @@ +# wite a program to find the sum of last 3 digit of university roll number +n=int(input("Enter your university roll number :")) +a=n%10 +n=n//10 +b=n%10 +n=n//10 +c=n%10 +n=n//10 +print("sum of last 3 digit of your university roll no is ",a+b+c) \ No newline at end of file diff --git a/tower of hanoi.py b/tower of hanoi.py new file mode 100644 index 0000000..5142f5e --- /dev/null +++ b/tower of hanoi.py @@ -0,0 +1,9 @@ +def toh(numbers,start,aux,end): + if numbers==1: + print("Move disk 1 from rod {} to {}".format(start,end)) + return + toh(numbers-1,start,end,aux) + print("Move disk {} from rod {} to {}".format(numbers,start,end)) + toh(numbers-1,aux,start,end) +disc=3 +toh(disc,"A","B","C") \ No newline at end of file diff --git a/triangle_checking_if_else12.py b/triangle_checking_if_else12.py new file mode 100644 index 0000000..3555094 --- /dev/null +++ b/triangle_checking_if_else12.py @@ -0,0 +1,22 @@ +#2) Write a Python program to check a triangle is equilateral, isosceles or scalene + + +n1=int(input("Enter the first side : ")) +n2=int(input("Enter the second side : ")) +n3=int(input("Enter the third side : ")) + + + +if n3**2==n1**2+n2**2: + print("Triangel is right angled! ") +elif n1==n2==n3: + print("The triangle is equilateral") + +elif (n1==n2 ) or (n2==n3) or (n3==n1) : + print("The triangle is isoscales") + +elif n1!=n2!=n1: + print("The triangle is scalene") +else: + print("Invalid triange !") + diff --git a/try7.py b/try7.py new file mode 100644 index 0000000..c7bdae0 --- /dev/null +++ b/try7.py @@ -0,0 +1,9 @@ +print("In the Quadratic equation\na(x^2)+bx+c, Enter such values") +a=float(input("Enter the value of 'a' : ")) +b=float(input("Enter the value of 'b' : ")) +c=float(input("Enter the value of 'c' : ")) +d=((b*b)-(4*a*c))**(1/2) +x1=(-b+d)/(2*a) +x2=(-b-d)/(2*a) +print("roots of the equation are") +print("x=",x1," x=",x2) diff --git a/two_wheeler_four_wheeler.py b/two_wheeler_four_wheeler.py new file mode 100644 index 0000000..2ca126c --- /dev/null +++ b/two_wheeler_four_wheeler.py @@ -0,0 +1,6 @@ +v=int(input("Enter total number of vehicles :")) +w=int(input("Enter total number of wheels : ")) +fw=w//2-v +tw=v-fw +print("No of two wheelers are : ",tw) +print("No of four wheelers are : ",fw) \ No newline at end of file diff --git a/voice.py b/voice.py new file mode 100644 index 0000000..4e34ef4 --- /dev/null +++ b/voice.py @@ -0,0 +1,5 @@ +import pyttsx3 +engine = pyttsx3.init() +a=input("Enter words:") +engine.say(a) +engine.runAndWait() diff --git a/vol.py b/vol.py new file mode 100644 index 0000000..3c10772 --- /dev/null +++ b/vol.py @@ -0,0 +1,4 @@ +r=int(input("enter radius")) +h=int(input("enter hieght")) +v=3.14*(r**2)*h +print(v) diff --git a/whatsapp.py b/whatsapp.py new file mode 100644 index 0000000..87fd2aa --- /dev/null +++ b/whatsapp.py @@ -0,0 +1,2 @@ +import pywhatkit +pywhatkit.sendwhatmsg('+919140175196','good morning',1,5) \ No newline at end of file