Skip to content
Open
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
17 changes: 17 additions & 0 deletions Bmi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
while True:
print('Welcome to Body Mass Index(BMI) Calculator ')
weight = int(input('Please Enter Your Weight in kg : '))
height = int(input('Please Enter Your Height in cm : '))
bmi = (weight/height**2)*10000
if bmi<25:
print("You are NORMAL")
elif 25<bmi<30:
print("You are OVERWEIGHT")
elif 30<=bmi<40:
print("You are OBESE")
else:
print("You are EXTREMELY OBESE")
choice = input("Do you want to Evaluate Another Person? Press Y for Yes, N for N0 --->")
if choice.upper() =='N':
print('Thanks for Using The Program. BYE...')
break
66 changes: 66 additions & 0 deletions CourseScorecalculation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
student_report = {}
while True: # This makes the program to run until the break statement
print('Welcome to Student Report Program ')
student_name = input('Please Enter the Student Name : ')
student_report['Name'] = student_name
student_surname = input('Please Enter the Student Surname : ')
student_report['Surname'] = student_surname
student_number = int(input('Please Enter the Student Number : '))
student_report['Number'] = student_number
course1_name = input('Please Enter the Course 1 : ')
student_report['First Course'] = course1_name
course1_visa = int(input('Please Enter the Visa Grade of the First Course :'))
student_report['Course1_visa'] = course1_visa
course1_final = int(input('Please Enter the Final Grade of the First Course :'))
student_report['Course1_final'] = course1_final
course2_name = input('Please Enter the Course 2 : ')
student_report['Second Course'] = course2_name
course2_visa = int(input('Please Enter the Visa Grade of the Second Course :'))
student_report['Course2_visa'] = course2_visa
course2_final = int(input('Please Enter the Final Grade of the Second Course :'))
student_report['Course2_final'] = course2_final
course3_name = input('Please Enter the Course 3 : ')
student_report['Third Course'] = course3_name
course3_visa = int(input('Please Enter the Visa Grade of the Third Course :'))
student_report['Course3_visa'] = course3_visa
course3_final = int(input('Please Enter the Final Grade of the Third Course :'))
student_report['Course3_final'] = course3_final
course4_name = input('Please Enter the Course 4 : ')
student_report['Fourth Course'] = course4_name
course4_visa = int(input('Please Enter the Visa Grade of the Fourth Course :'))
student_report['Course4_visa'] = course4_visa
course4_final = int(input('Please Enter the Final Grade of the Fourth Course :'))
student_report['Course4_final'] = course4_final
for key,value in student_report.items():
print(key,value)
course1_average = ((course1_visa*40/100)+(course1_final*60/100))
course2_average = ((course2_visa*40/100)+(course2_final*60/100))
course3_average = ((course3_visa*40/100)+(course3_final*60/100))
course4_average = ((course4_visa*40/100)+(course4_final*60/100))
result={}
if course1_average<50:
result1 ='FAILED'
else:
result1 ='PASSED'
result[course1_name]= result1
if course2_average<50:
result2 ='FAILED'
else:
result2 ='PASSED'
result[course2_name]= result2
if course3_average<50:
result3 ='FAILED'
else:
result3 ='PASSED'
result[course3_name]= result3
if course4_average<50:
result4 ='FAILED'
else:
result4 ='PASSED'
result[course4_name]= result4
for key,value in result.items():
print(key,value)
choice = input("Do you want to Enter Another Student? Press Y for Yes, N for N0 --->")
if choice.upper() =='N':
print('Thanks for Using The Program. BYE...')
break
60 changes: 60 additions & 0 deletions RockScissorsPaperGame.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
user_choice = {}
user1 = input("Enter User Name 1 : ")
user2 = input("Enter User Name 2 : ")
score_user1 = 0
score_user2 = 0
while True:
i = 0
while i <= 10:
user1_choice = input("Enter a choice (rock, paper, scissors): ")
user2_choice = input("Enter a choice (rock, paper, scissors): ")
user_choice[user1] = user1_choice
user_choice[user2] = user2_choice
print(user_choice)
if user1_choice == user2_choice:
print("Both players selected" ,user1_choice, " it a tie!")


print(user1,'has',score_user1,'points and',user2,'has',score_user2,'points')
elif user1_choice == "rock":
if user2_choice == "scissors":
print("Rock smashes scissors!", user1, "Gets 1 Point!")
score_user1 = score_user1+1
print(user1,'has',score_user1,'points and',user2,'has',score_user2,'points')
else:
print("Paper covers rock!", {user2}, "Gets 1 Point!")
score_user2 = score_user2+1
print(user1,'has',score_user1,'points and',user2,'has',score_user2,'points')
elif user1_choice == "paper":
if user2_choice == "rock":
print("Paper covers rock!" , user1, "Gets 1 Point!")
score_user1 = score_user1+1
print(user1,'has',score_user1,'points and',user2,'has',score_user2,'points')
else:
print("Scissors cuts paper!" , user2, "Gets 1 Point!")
score_user2 = score_user2+1
print(user1,'has',score_user1,'points and',user2,'has',score_user2,'points')
elif user1_choice == "scissors":
if user2_choice == "paper":
print("Scissors cuts paper!", user1, "Gets 1 Point!")
score_user1 = score_user1+1
print(user1,'has',score_user1,'points and',user2,'has',score_user2,'points')
else:
print("Rock smashes scissors!" , user2, "Gets 1 Point")
score_user2 = score_user2+1
print(user1,'has',score_user1,'points and',user2,'has',score_user2,'points')
i+=1
if score_user1 > score_user2:
print(user1,"WINS!")
elif score_user2 > score_user1:
print(user2,"WINS THE GAME!")
else:
print("It's a tie!")
play = input("Do you want to play again? Press Y for Yes, N for N0 --->")
if play.upper() == "Y":
i=0
continue
else:
print("BYE")
break