├── .idea
├── .gitignore
├── Randomrandintgame-python.iml
├── inspectionProfiles
│ ├── Project_Default.xml
│ └── profiles_settings.xml
├── misc.xml
├── modules.xml
└── vcs.xml
├── algorithm.py
└── game.py
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Editor-based HTTP Client requests
5 | /httpRequests/
6 | # Datasource local storage ignored files
7 | /dataSources/
8 | /dataSources.local.xml
9 |
--------------------------------------------------------------------------------
/.idea/Randomrandintgame-python.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/algorithm.py:
--------------------------------------------------------------------------------
1 | def check_rent(P, H, R):
2 | earnings = P * H
3 | if earnings > R:
4 | print("YES")
5 | elif earnings == R:
6 | print("BARELY")
7 | else:
8 | print("NO")
9 |
10 | # Reading input
11 | P = int(input()) # Pay per hour
12 | H = int(input()) # Hours worked
13 | R = int(input()) # Rent
14 |
15 | check_rent(P, H, R)
16 | # The function check_rent calculates the earnings based on the pay per hour and hours worked,
17 | # and compares it with the rent to determine if the earnings are sufficient to cover the rent.
--------------------------------------------------------------------------------
/game.py:
--------------------------------------------------------------------------------
1 | import random
2 |
3 | choice1, choice2 = input("please enter the players choices: ").split()
4 | main = choice1, choice2
5 | print(main)
6 |
7 | if choice1 == choice2:
8 | print("It's a tie!")
9 | elif choice1 == "rock" and choice2 == "paper":
10 | print("player2 wins!")
11 | elif choice1 == "rock" and choice2 == "scissors":
12 | print("player1 wins!")
13 | elif choice1 == "paper" and choice2 == "rock":
14 | print("player1 wins!")
15 | elif choice1 == "paper" and choice2 == "scissors":
16 | print("player2 wins!")
17 | elif choice1 == "scissors" and choice2 == "rock":
18 | print("player2 wins!")
19 | elif choice1 == "scissors" and choice2 == "paper":
20 | print("player1 wins!")
21 | elif choice1 == choice2:
22 | print("It's a tie!")
23 | else:
24 | print("Invalid input!")
25 |
26 |
--------------------------------------------------------------------------------