Skip to content

Commit 1e660c9

Browse files
committed
Some more string function examples
1 parent 8cc77ab commit 1e660c9

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Python3/strings.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
str1 = "some string"
22

3-
print(str1.title())
4-
print(str1.upper())
5-
print(str1.lower())
3+
print(str1.title()) #Some String
4+
print(str1.upper()) #SOME STRING
5+
print(str1.lower()) #some string
6+
print(str1.capitalize()) #Some string
7+
print(str1.swapcase()) #SOME STRING
8+
print(str1.replace("some", "another")) #another string
9+
print(str1.isupper()) #False
10+
print(str1.islower()) #True
611

712
#f-strings
813
first_name = "john"

0 commit comments

Comments
 (0)