FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python4all/code/strings/string_methods.py at main · bachinaram/python4all · GitHub
bachinaram
/
python4all
Public
Notifications
You must be signed in to change notification settings
Fork
2
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python4all
/
code
/
strings
/
string_methods.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
34 lines (24 loc) · 1.02 KB
Breadcrumbs
python4all
/
code
/
strings
/
string_methods.py
Copy path
File metadata and controls
34 lines (24 loc) · 1.02 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
statement1
=
"this is python programming class"
statement2
=
"THIS IS PYTHON PROGRAMMING CLASS"
statement3
=
"this is python programming class"
statement4
=
"thIs Is pyThon progrAMminG class"
print
(
statement1
.
upper
())
#converts case to upper case
print
(
statement2
.
lower
())
#converts case to lower case
print
(
statement1
.
lower
())
#converts case to lower case
print
(
statement4
.
capitalize
())
#converts sentence to first chat to upper and remaining all to small
print
(
statement4
.
swapcase
())
#converts all capital letter to small and small letter to Capital
if
statement1
==
statement4
:
print
(
"both statements are same"
)
else
:
print
(
"both statements are different"
)
#how to make sure both sentenance same irrespective of cases
if
statement1
.
upper
()
==
statement4
.
upper
():
print
(
"both statements are same"
)
else
:
print
(
"both statements are different"
)
#split
message
=
"hello, students"
print
(
"message is"
,
type
(
message
))
my_list
=
message
.
split
(
','
)
print
(
"my_list is"
,
type
(
my_list
))
print
(
message
.
split
(
','
))
Back
|
FazBrowse Home
|
New Git URL