forked from easyawslearn/Python-Tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathString-Formating.py
More file actions
50 lines (42 loc) · 1.39 KB
/
String-Formating.py
File metadata and controls
50 lines (42 loc) · 1.39 KB
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
49
50
# Python String Formating Demostration
# Python program to demonstrate the
# use of capitalize() function
# capitalize() first letter of
# string.
example = "Python LEARNINF"
print ("String make to capitalize\n")
print(example.capitalize())
# demonstration of individual words
# capitalization to generate camel case
name1 = "hello"
name2 = "world"
print ("2 String make to capitalize\n")
print(name1.capitalize() + name2.capitalize())
# Python code for implementation of isupper()
# checking for uppercase characters
string = 'PYTHON LEARNING'
print (string)
print ("\nChecking String is upper case\n")
print(string.isupper())
print ("\nChanging string upper case to lower\n")
#change staring case using lower function
print (string.lower())
string = 'python learning'
# Python code for implementation of isupper()
# checking for uppercase characters
print (string)
print ("\nChecking String is upper case\n")
print(string.isupper())
#change staring case using lower function
print ("\nChanging string lower case to upper\n")
print (string.upper())
string = "Python Learning"
# Python code for implementation of swapcase()
print (string)
print ("\nChanging string case using swapcase function\n")
print (string.swapcase())
string = "python learning"
# Python code for implementation of title()
print (string)
print ("\n make title of string\n")
print (string.title())