1# Newer f-string format
2name = "Foo"
3age = 12
4print(f"Hello, My name is {name} and I'm {age} years old.")
5# output :
6# Hello, my name is Foo and I'm 12 years old.
1string_a = "Hello"
2string_b = "Cena"
3
4# Index based:
5print("{0}, John {1}"
6 .format(string_a, string_b))
7# Object based:
8print("{greeting}, John {last_name}"
9 .format(greeting=string_a, last_name=string_b))
10
1# Basic syntax:
2print(f"string {adjustable_input_1} more string {adjustable_input_2}")
3
4# Example usage:
5name = "Joe Bob"
6age = 23
7print(f"My name is {name} and I am {age} years old")
8--> My name is Joe Bob and I am 23 years old