Skip to content
This repository was archived by the owner on Jun 29, 2024. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions Guessing_number_game.py
Original file line number Diff line number Diff line change
@@ -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<y:
print("You guessed a number which is greater than the Computer number")
i+=1
else:
print("Entered a number which is out the range!!!")
print("THE RANGE OF THE NUMBERS TO GUESS IS FROM 1 TO 100")
i+=1

else:
print("you reached your maximum limit!!!")
print("The number generated by the computer is",C)
else:
print("We will play next time!!\n\n THANK YOU!!!")
24 changes: 24 additions & 0 deletions PDF_TO_DIFFERENT_FORMATS_CONVERTER.py
Original file line number Diff line number Diff line change
@@ -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()
37 changes: 37 additions & 0 deletions simple_calculator.py
Original file line number Diff line number Diff line change
@@ -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()