Skip to content

Commit 4cc7de2

Browse files
committed
Print methods added
1 parent 0b442fa commit 4cc7de2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Basics/Print-Methods.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Normal printing with the print function
2+
print("Hello, World!") # Output: Hello, World!
3+
4+
# Using variables
5+
name = "John"
6+
age = 25
7+
print("Name:", name, "Age:", age)
8+
# Output: Name: John Age: 25
9+
10+
# F-string printing
11+
print(f"My name is {name} and I am {age} years old.")
12+
# Output: My name is John and I am 25 years old.

0 commit comments

Comments
 (0)