python-crash-course/Chapter_06/6-03_glossary.py
2025-01-26 20:26:14 -05:00

21 lines
795 B
Python

# Exercise 6-3 Glossary
# Learning Objective: Print key value pairs with formatting.
words = {
'loop': 'A repetetive process of actions.',
'operator': 'A symbol of an action to take place.',
'if statement': 'A conditional process.',
'variable': 'An object that can change its value.',
'constant': 'An object whose value does not change.',
}
print(f"Loop:\n{words['loop']}\n--------------------------------------------")
print(f"\nOperator:\n{words['operator']}\n--------------------------------------------")
print(f"\nif Statement:\n{words['if statement']}\n--------------------------------------------")
print(f"\nVariable:\n{words['variable']}\n--------------------------------------------")
print(f"\nConstant:\n{words['constant']}\n--------------------------------------------")