“Fallfold in Python” Code-Antworten

Fallfold in Python

s1 = 'ß'
s2 = 'ss'
s3 = 'SS'
if s1.casefold() == s2.casefold():
    print('Casefolded strings of s1 and s2 are equal')
else:
    print('Casefolded strings of s1 and s2 are not equal')
 
if s1.casefold() == s3.casefold():
    print('Casefolded strings of s1 and s3 are equal')
Mighty Unicorn

Fallfold in Python

my_str = "Hello from AskPython"
 
casefolded_str = my_str.casefold()
 
print(casefolded_str)
Mighty Unicorn

Fallfold in Python

string = "PYTHON IS AWESOME"
# casefold is used to lowercase the string
# print lowercase string
print("Lowercase string:", string.casefold())
Mighty Unicorn

Ähnliche Antworten wie “Fallfold in Python”

Fragen ähnlich wie “Fallfold in Python”

Weitere verwandte Antworten zu “Fallfold in Python” auf Python

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen