Repository navigation
Expand file tree
/
Copy pathconditionals_challenges.py
More file actions
50 lines (36 loc) · 1.67 KB
/
Copy pathconditionals_challenges.py
File metadata and controls
50 lines (36 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
def can_climb(has_helmet: bool, has_rope: bool):
"""To go rock climbing, you need a helmet and some rope. This function
calculates whether you are able to go rock climbing.
Arguments:
- has_helmet: a boolean representing whether or not the climber has their helmet
- has_rope: a boolean representing whether or not the climber has their rope
Returns:
- a boolean that is true when the climber is allowed to climb, and false otherwise.
"""
pass
def red_light_camera(light_colour: str, car_detected: bool):
"""A function to determine whether or not a driver should get a ticket
for running a red light.
Arguments:
- light_colour: a string representing the colour of the light.
Valid colours are "Red", "Amber", or "Green"
- car_detected: a boolean representing whether or not a car
is driving through the intersection.
Returns: A boolean that is true if a car ran the red light, and false otherwise.
"""
pass
def can_ride_rollercoaster(rider_height: float):
"""Only people who are over 120cm in height can ride the rollercoaster.
Arguments:
- rider_height: a float representing the height of the prospective rider in centimetres
Returns: a boolean representing whether or not the prospective rider is allowed on the rollercoaster.
"""
pass
def login(password: str):
"""Only users who enter the password "quartzgleam?1" can log in successfully.
Arguments:
- password: a string representing the user's password input.
Returns:
- a boolean representing whether or not the user's password was correct.
"""
pass