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
52 changes: 52 additions & 0 deletions assignment_1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# HOMEWORK_1
# Take the names of the players and play the stone - paper - scissors game.
# Game 10 hands it will last. At the end of 10 hands, the winner will be determined.
# The score will be displayed at the end.

player1 = input("Enter your name: ")
player2 = input("Enter your name: ")
scoreOfThePlayer1 = 0
scoreOfThePlayer2 = 0

i = 0
while i < 10:
i +=1
choice1 = input(player1 + "! Please choice your game: Stone, Paper or Scissors: ")
choice2 = input(player2 + "! Please choice your game: Stone, Paper or Scissors: ")
if choice1==choice2:
print("No winner. Please try again")
elif choice1 == "Stone":
if choice2 == "Paper":
print(player2, "won.")
scoreOfThePlayer2 +=1
else:
print(player1, "won.")
scoreOfThePlayer1 +=1
elif choice1 == "Paper":
if choice2 == "Stone":
print(player1, "won.")
scoreOfThePlayer1 +=1
else:
print(player2, "won.")
scoreOfThePlayer2 +=1
elif choice1 == "Scissors":
if choice2 == "Stone":
print(player2, "won.")
scoreOfThePlayer2 +=1
else:
print(player1, "won.")
scoreOfThePlayer1 +=1

print(player1, "has totally", scoreOfThePlayer1, "points.")
print(player2, "has totally", scoreOfThePlayer2, "points.")

if scoreOfThePlayer1 > scoreOfThePlayer2:
print(player1, "won the game. Congratulations!")
elif scoreOfThePlayer1 == scoreOfThePlayer2:
print("Neither", player1, "nor", player2, "won!")
else:
print(player2, "won the game. Congratulations!")




31 changes: 31 additions & 0 deletions assignment_2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# # HOMEWORK_2
# User Name, Surname, Student Number, 4 course names, Visa and Final grades will be required.
# The sum of 40% of the midterm grade and 60% of the final grade will give the year-end average.
# If the average is less than 50, “FAILED” on the screen, 50 and above, “PASSED” will be printed on the screen.
# This printing process is in 4 lessons. will be done and the lessons will be written one after the other.

userName=input('Please enter an username: ')
surname=input('Please enter a surname: ')
studentNumber=int(input('Please enter student number: '))
courses= ['python','java','matlab','c++']
visaGrades = [0] * (4)
finalGrades = [0] * (4)


for x in range(len(courses)) :
print("Visa Grade for " + courses[x])
visa = input()
visaGrades[x] = visa
print("Final Grade for " + courses[x])
finall = input()
finalGrades[x] = finall
x+= 1

i = 0
while (i < len(courses)) :
average = float(visaGrades[i]) * 0.4 + float(finalGrades[i]) * 0.6
if (average < 50) :
print(courses[i] + ": Failed")
else :
print(courses[i] + ": Passed")
i += 1
21 changes: 21 additions & 0 deletions assignment_3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# HOMEWORK_3
# Parameter showing whether a person's weight is normal for their height.
# It is called Body Mass Index. In short, a person's weight is equal to a person's height.
# If we divide it by its square, the body mass index is obtained.
# User's weight and height If the result by taking the length is below 25, NORMAL,
# if it is between 25-30 OVER WEIGHT,
# OBSE if 30-40,
# EXTREMELY OBSE if 40 and over print a warning

height = float(input("Please enter your height(meter): "))
weight = int(input("Please enter your weight(kg): "))
bodyMassIndex = weight/(height**2)
if bodyMassIndex<=25:
print(bodyMassIndex, "NORMAL")
elif 25<bodyMassIndex<=30:
print(bodyMassIndex, "OVER WEIGHT")
elif 30<bodyMassIndex<=40:
print(bodyMassIndex, "OBSE")
elif bodyMassIndex>40:
print(bodyMassIndex, "EXTREMELY OBSE")
print("WARNING!!!")