Capsule 1
Capsule 1
Then, prompt
the user to enter two values. After receiving the values, swap them and print both the ordiginal
values and the swapped values.
print(f"Hello, {name}!")
# Swap values
temp = val1
val1 = val2
val2 = temp
area = pi * radius**2
Write a Python program where customers are prompted to input their name and favorite cake flavor.
The program should then print a customized message saying: "Hello, [name]! We're delighted to
serve you your favorite [favorite_cake] cake on your birthday. Happy Birthday."
message = f"Hello, {name}! We're delighted to serve you your favorite {favorite_cake} cake on your
birthday. Happy Birthday!"
print(message)
Q5) Write a Python program to calculate the simple interest with user input for principal amount,
rate, and time.