From c952915905fca057a9436af8be094acfb48ff186 Mon Sep 17 00:00:00 2001 From: Junuthulakavya <167897707+Junuthulakavya@users.noreply.github.com> Date: Sat, 11 May 2024 07:12:26 +0530 Subject: [PATCH 1/3] Add files via upload --- Guessing_number_game.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Guessing_number_game.py diff --git a/Guessing_number_game.py b/Guessing_number_game.py new file mode 100644 index 0000000..b06f3a3 --- /dev/null +++ b/Guessing_number_game.py @@ -0,0 +1,34 @@ +import random as rd +s="*"*10 +i=1 +print(s,"welcome to number guessing game",s) +print("computer is ready to choose a number") +C=rd.randint(1,100) + +print("Are you ready to guess that number") +print("if yes \n Enter 1 \n if No \n Enter 2") +x=int(input()) +if x==1: + print("NOTE: you have only 5 chances to guess the number") + print("ALL THE BEST!!!") + while i<=5: + y=int(input("enter your number")) + if C==y: + print(s,"Hurray!!! you got the number",s) + i==5 + elif C>y: + print("You guessed a number which is less than the Computer number") + i+=1 + elif C Date: Sat, 11 May 2024 07:49:19 +0530 Subject: [PATCH 2/3] Add files via upload --- simple_calculator.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 simple_calculator.py diff --git a/simple_calculator.py b/simple_calculator.py new file mode 100644 index 0000000..978f097 --- /dev/null +++ b/simple_calculator.py @@ -0,0 +1,37 @@ +def add(x,y): + return x+y +def sub(x,y): + return x-y +def mul(x,y): + return x*y +def div(x,y): + return x/y +def moddiv(x,y): + return x%y +print("ENTER 1.ADDITION \n\n 2.SUBTRACTION \n\n 3.MULTIPLICATION \n\n 4.DIVISION \n\n 5.MODULUS_DIVISION\n\n 6.EXIT\n\n") +#ch=int(input("Enter Your Choice:")) +n=int(input("enter no of operations you want to do:").upper()) +for i in range(1,n+1): + ch=int(input("Enter Your Choice:")) + if ch==1: + x=int(input("enter x value:").capitalize()) + y=int(input("enter x value:").capitalize()) + print("THE SUM OF",x,"AND",y,"IS",add(x,y)) + elif ch==2: + x=int(input("enter x value:").capitalize()) + y=int(input("enter x value:").capitalize()) + print("THE SUBTRACTION OF",x,"AND",y,"IS",sub(x,y)) + elif ch==3: + x=int(input("enter x value:").capitalize()) + y=int(input("enter x value:").capitalize()) + print("THE MULTIPLICATION OF",x,"AND",y,"IS",mul(x,y)) + elif ch==4: + x=int(input("enter x value:").capitalize()) + y=int(input("enter x value:").capitalize()) + print("THE DIVISION OF",x,"BY",y,"IS",div(x,y)) + elif ch==5: + x=int(input("enter x value:").capitalize()) + y=int(input("enter x value:").capitalize()) + print("THE MODDIVISON OF",x,"AND",y,"IS",moddiv(x,y)) + else: + exit() \ No newline at end of file From 986a91e2c28a7f376216169e73894ebe0f4dfdf4 Mon Sep 17 00:00:00 2001 From: Junuthulakavya <167897707+Junuthulakavya@users.noreply.github.com> Date: Sat, 11 May 2024 09:20:14 +0530 Subject: [PATCH 3/3] Add files via upload --- PDF_TO_DIFFERENT_FORMATS_CONVERTER.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 PDF_TO_DIFFERENT_FORMATS_CONVERTER.py diff --git a/PDF_TO_DIFFERENT_FORMATS_CONVERTER.py b/PDF_TO_DIFFERENT_FORMATS_CONVERTER.py new file mode 100644 index 0000000..1d3f71f --- /dev/null +++ b/PDF_TO_DIFFERENT_FORMATS_CONVERTER.py @@ -0,0 +1,24 @@ +import PyPDF2 +from pdf2image import convert_from_path +from pdf2docx import parse +print("1.PDF-TO-TXT-FILE\n\n\n2.PDF-IMAGE\n\n\n3.PDF-DOCUMENT\n\n\n") +ch=int(input("ENTER YOUR CHOICE:")) +if ch==1: + pdffileobj=open('filename.pdf','rb') + pdfreader=PyPDF2.PdfFileReader(pdffileobj) + x=pdfreader.numPages + pageobj=pdfreader.getPage(x+1) + text=pageobj.extractText() + file1=open("file path","a") + file1.writelines(text) +elif ch==2: + pdf_images = convert_from_path('pdf_name.pdf') + for idx in range(len(pdf_images)): + pdf_images[idx].save('pdf_page_'+ str(idx+1) +'.png', 'PNG') + print("Successfully converted PDF to images") +elif ch==3: + pdf_file = r"pdf file_path name.pdf" + docx_file = r"document_path_name.docx" + parse(pdf_file, docx_file) +else: + exit() \ No newline at end of file