-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstrings.py
More file actions
49 lines (33 loc) · 929 Bytes
/
strings.py
File metadata and controls
49 lines (33 loc) · 929 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
curso = "pYtHon Language"
print(curso.upper())
# PYTHON LANGUAGE
print(curso.lower())
# python language
print(curso.capitalize())
# Python language
print(curso.title())
# Python Language
print(curso.swapcase())
# PyThON lANGUAGE
print(curso.strip())
# pYtHon Language
print(curso.replace("Language", "Programming"))
#--------------------------------------------------------------------------------------
curso2 = " Python "
print(curso2.strip())
# Python
print(curso2.lstrip())
# Python
print(curso2.rstrip())
# Python
# --------------------------------------------------------------------------------------
curso3 = "Python"
print(curso3.center(10, "#"))
# ##Python##
print(curso3.ljust(10, "#"))
# Python----
print(curso3.rjust(10, "#"))
# ****Python
print(".".join(curso3))
# P.y.t.h.o.n
#--------------------------------------------------------------------------------------