SIMULATION
Write a complete function calculate_discount(price, discount_percent) that calculates and returns the final price after applying a discount percentage.
For example, calculate_discount(75, 20) should return 60.0.
def calculate_discount(price, discount_percent):
# TODO: Calculate and return the final price after discount
pass
SIMULATION
Fix the missing return statement in this function that should return whether a number is even.
def is_even(number):
if number % 2 == 0:
True
else:
False
Which data type is the value 3.14 in Python?
SIMULATION
Write a complete function reverse_string(text) that takes a string and returns it reversed.
For example, reverse_string("hello") should return "olleh".
def reverse_string(text):
# TODO: Return the reversed string
pass
Which index position is returned when the string method .find('python') is applied to the string 'learning python programming'?