Skip to content

Instantly share code, notes, and snippets.

View leandjb's full-sized avatar

Leandro Barros Ortiz leandjb

  • Tech Mahindra
  • Colombia
View GitHub Profile
@leandjb
leandjb / python-string-f-examples.py
Created February 26, 2024 14:57
Tips for using Python F-strings more effectively and complete with small code examples.
#1. Expressions Inside Braces
name = "Alice"
age = 30
print(f"{name} is {age + 1} years old next year.")
#2. Calling Functions
def greet(name):
return f"Hello, {name}!"
print(f"{greet('Bob')}")