In [5]:
print("#SET 1")
#SET 1
In [1]:
def get_country_capital():
    capitals = {
        "Indonesia": "Jakarta",
        "Philippines": "Manila",
        "Japan": "Tokyo",
        "China": "Beijing",
        "USA": "Washington, D.C."
    }
    
    country = input("Please enter a country: ")
    
    capital = capitals.get(country, "Capital not found")
    
    return capital

# Usage:
capital = get_country_capital()
print(f"The capital is: {capital}")
Please enter a country: Japan
The capital is: Tokyo
In [2]:
def odd_or_even_checker(num1, num2):
    # Calculate the sum of the two input numbers
    total = num1 + num2
    
    # Check if the sum is even or odd
    if total % 2 == 0:
        return "Even"
    else:
        return "Odd"

# Usage:
number1 = int(input("Enter the first number: "))
number2 = int(input("Enter the second number: "))

result = odd_or_even_checker(number1, number2)
print(f"The sum of {number1} and {number2} is {result}.")
Enter the first number: 4
Enter the second number: 6
The sum of 4 and 6 is Even.
In [12]:
def centimeters_converter(cm):
    # Convert the cm to inches
    m = cm / 100
    
    return m

#Usage
measurement = int(input("Enter centimeters value: "))
converted = centimeters_converter(measurement)

print(f"The {measurement} cm is converter to {converted} m.")
Enter centimeters value: 254
The 254 cm is converter to 2.54 m.
In [ ]: