Skip to content

Commit a2040f5

Browse files
committed
Text Alignment
1 parent 2c02bdf commit a2040f5

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

ex-7(Text alignment).py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
text = "Python"
2+
3+
4+
left_aligned = text.ljust(20)
5+
print(f"Left aligned: '{left_aligned}'")
6+
7+
8+
right_aligned = text.rjust(20)
9+
print(f"Right aligned: '{right_aligned}'")
10+
11+
12+
center_aligned = text.center(20)
13+
print(f"Center aligned: '{center_aligned}'")

0 commit comments

Comments
 (0)