Unit: Unit 4: Strings, Lists, and Tuples • Interactive Practice
Interactive Python programming tutorial and practice in your browser.
# Normalize user input for case-insensitive verification
user_command = "Quit"
headline = "python 3.12 introduces faster comprehension execution"
# 1. Convert to uppercase and lowercase
command_lower = user_command.lower()
command_upper = user_command.upper()
# 2. Case-insensitive equality check
is_exit_command = command_lower == "quit"
# 3. Title case headline
formatted_headline = headline.title()
print("Lowercase:", command_lower)
print("Uppercase:", command_upper)
print("Is Exit Command:", is_exit_command)
print("Title Case:", formatted_headline)