Assign the string value 'Everest' to a variable named mountain
. Then embed it into the message below, by replacing the word 'hill'.
message = 'I would like to climb hill!'
print(message)
# YOUR CODE HERE
raise NotImplementedError()
### BEGIN TESTS
assert mountain == 'Everest'
assert message == f"I would like to climb Everest!"
### END TESTS
Create a variable suffix
, 'Mt.', to make things more formal. Use string arithmetic to add this to 'mountain', creating a new variable full_name
and print it. Don't forget the space between the two!
# YOUR CODE HERE
raise NotImplementedError()
print(full_name)
### BEGIN TESTS
assert full_name == "Mt. Everest"
### END TESTS
Mt. Everest is 29,029 feet tall. How many meters is this? Use arithmetic to create 'meter_height', as well as 'meter_height_rounded', rounding down to the nearest meter. Change your rounded figure to an integer type. Assume a value of 3.3 feet per meter.
# YOUR CODE HERE
raise NotImplementedError()
print(meter_height)
print(meter_height_rounded)
print(type(meter_height))
print(type(meter_height_rounded))
### BEGIN TESTS
assert meter_height == 8796.666666666668
assert meter_height_rounded == 8796
assert type(meter_height_rounded) == int
### END TESTS
Let's calculate the volume of Mt. Everest, in cubic feet.
To do so, let's assume it is cone shaped. The formula for volume of a cone is: $$ V = \pi r^2 \frac h3 $$ Where r is the radius, and h is the height of the cone.
Assume the radius is 1 mile, or 5,280 feet, and the value of pi is 3.14.
height = 29029
radius = 5280
pi = 3.14
# YOUR CODE HERE
raise NotImplementedError()
print(volume)
### BEGIN TESTS
assert volume == 8796.666666666668
### END TESTS
Wow, that's a big number!
Let's return to our restaurant from the prior exercise. Use python built in functions to return the maximum, minimum and total of the daily profits below.
profits = [2000, -150, 400, 1250, 42, -600, 15]
max_profit =
min_profit =
total_profit =
# YOUR CODE HERE
raise NotImplementedError()
print(max_profit)
print(min_profit)
print(total_profit)
### BEGIN TESTS
assert max_profit == 2000
assert min_profit == -600
assert total_profit == 2957
### END TESTS