If you are stuck or would like to check the solution(s), please feel free to ask!
def mass(length, width, height, density)import math and call sqrt().
def hypotenuse(a, b)%.
def is_even(n)def am_or_pm(n)def not_string(s)def min_of_two(x, y)min_of_two function. Then try to write the same function without using min_of_two. Which do you prefer and why?
def min_of_three(x, y, z)def is_leap_year(n)my_animals = [...]my_animals using the append() function.sorted_animals.sorted_animals.sorted_animals.axolotl.def print_range()nums, square each element greater than 10. Do not alter the other elements. Return the new nums list.
def square_some(nums)nums, return True if the list is sorted. Otherwise, return False.
def is_sorted(nums)s and a character x, count the number of times x occurs in the string.
def count_x(s, x)n! using a for loop. Here is more information on factorial.
def factorial(n)def mean(nums)def list_max(lst)def calculate_total(prices)prices_list = [9.89,
7.52,
4.55,
3.24,
3.40,
4.17,
7.00,
14.10,
13.54,
6.25,
14.26,
11.05,
7.57,
10.36,
13.15,
11.06,
3.74,
15.12,
19.32,
14.73]. If you use this list, your answer should be around $213.91.
fruit_prices with fruits and their respective prices per pound. Include at least five different entries. For example, as a starting point:
fruit_prices = {"apple" : 1.99, "orange" : 2.49}x pounds of y fruit. Given x, y, and a store's catalog as a dictionary catalog, return how much the customer should expect to pay. Return None if the fruit is not found in the catalog. Hint: use the fruit_prices dictionary as your catalog when testing out your function.
def calculate_fruit_cost(catalog, x, y)x, returned as a list. For example, if the price of bananas is $1.50 a pound, return the list [1.5, 3.0, 4.5, 6.0, 7.5].
def calculate_fruit_costs(catalog, x)baseball_scores = [(1, 2), (3, 1), (0, 1)]baseball_scores as the function input while testing.
def find_winner(score_tuples)def win_percentage(score_tuples)shirts = ["red", "yellow"], pants = ["blue", "black"], printred shirt, blue pants
yellow shirt, blue pants
red shirt, black pants
yellow shirt, black pants
def shirt_pants_combinations(shirt_colors, pant_colors)[("red", "blue"), ("yellow", "blue"), ("red", "black"), ("yellow", "black")].