Code viewer for World: f-strings
"""
Topic: f-Strings
Purpose: Understand how to make printing cleaner using f-strings
Output: Displays variable values and types in a simple, readable way
"""

# -----------------------------
# 1. Example variables
# -----------------------------
age = 10               # Integer
height = 4.5           # Float
name = "Aaqid"         # String
is_student = True      # Boolean

# -----------------------------
# 2. Printing without f-strings (messy)
# -----------------------------
print("Without f-strings:")
print("Value:", age, "Type:", type(age)) # This is a bit messy isn't it? Too many commas and qoutes. 
print("Value:", height, "Type:", type(height))
print("Value:", name, "Type:", type(name))
print("Value:", is_student, "Type:", type(is_student))

# -----------------------------
# 3. Printing with f-strings (clean and easy)
# -----------------------------
print("\nWith f-strings:")
print(f"Value: {age}, Type: {type(age)}") # You start the string with f"" and inject the variable between {}
print(f"Value: {height}, Type: {type(height)}") # Notice how you can even do type(height) within the {}
print(f"Value: {name}, Type: {type(name)}") # You can put any variable or expressions in the {}
print(f"Value: {is_student}, Type: {type(is_student)}") 

# -----------------------------
# 4. Notes
# -----------------------------
# 1. f-strings start with the letter f before the quotes.
# 2. Variables or expressions go inside curly braces {}.
# 3. They make your print statements cleaner and easier to read.
# 4. You can include calculations or function calls inside {} as well.