My Python Projects
My Python Projects
1) Quiz Game
Code:
print ('*****************************************')
print (' "Welcome to my Computer Quiz game" ')
print ('*****************************************')
playing = input ('Do you want to play? ')
if playing.lower () != 'yes':
print ('Okey Will Play another time!')
quit ()
else:
print ("Okey! Lets Play")
score = 0
ans = input ('Q:1) What does CPU Stands for? ')
if ans.lower () == 'central processing unit':
print ('Correct! ')
score += 1
else:
print ('Incorrect!')
print ('Incorrect!')
ans = input ('Q:7) What is the largest country in the world? ')
if ans.lower () == 'russia':
print ('Correct! ')
score += 1
else:
print ('Incorrect!')
print ('*****************************************')
print ('You answered ' + str (score) + ' questions correct out of 8
')
print ('You scored: ' + str ((score / 8) * 100) + '% ')
print ('*****************************************')
Output:
2) Mad Libs Generator Game:
Code:
print('***********************************************************')
print(' "Mad Libs Generator Game!" ')
print('***********************************************************')
ans = input('Do you want to play? ')
if ans.lower()!='yes':
print("It's Okey, we'll play next time")
quit()
else:
animals = input ('enter a animal name : ')
profession = input ('enter a profession name: ')
cloth = input ('enter a name of outfit: ')
things = input ('enter a thing name: ')
name = input ('enter a name: ')
place = input ('enter a place name: ')
verb = input ('enter a verb in ing form: ')
food = input ('food name: ')
print('***********************************************************')
print (' "MAD Story" ')
print('***********************************************************')
print (
'say ' + food + ', the photographer said as the camera flashed! \n' +
name + ' and I had gone to ' + place + ' to get our photos taken on my
birthday. \nThe first photo we really wanted was a picture of us dressed \nas
' + animals + ' pretending to be a ' + profession + '. \nwhen we saw the
second photo, it was exactly what I wanted. \nWe both looked like ' + things +
' wearing ' + cloth + '\nand ' + verb + ' --exactly what I had in mind')
print ('***********************************************************')
ans1 = input('Do you wanna play again? ')
if ans1.lower()!='yes':
print('Okey see you soon')
quit()
else:
def speedcheck():
sp = speedtest.Speedtest()
sp.get_servers()
down = str(round(sp.download()/(10**6),3))+'Mbps'
up = str(round(sp.upload()/(10**6),3))+'Mbps'
lab_down.config(text=down)
lab_up.config(text=up)
sp = Tk()
sp.title('Internet Speed Test')
#geometry make a size
sp.geometry('500x650')
#config create the bg color, font size etc
sp.config(bg='Light Blue')
#lab is a variable for labeling somethin
lab = Label(sp,text='Internet Speed Test',
font=('Algerian',25,'bold'),bg='Light Blue', fg='Purple')
#to see the spacing
lab.place(x=60,y=40,height=50,width=380)
sp.mainloop()
Output: