Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
7 views
in Python by (2.6k points)
edited by
How can I convert a str from uppercase, or half uppercase to lowercase?

E.x. "Decimeter" to "decimeter"

2 Answers

0 votes
by (10.9k points)
edited by

@Krishna, To lowercase a string in Python you can use .lower() function:

x=”Decimeter”

Print(x.lower())

Returns: decimeter

For more details take a look here- https://docs.python.org/3/library/stdtypes.html?highlight=str.lower#str.lower

0 votes
by (106k points)
edited by

You can use the below-mentioned code:-

>>> s='Километр'

>>> print s.lower()

Километр

>>> print s.decode('utf-8').lower()

километр

You can use the following video tutorials to clear all your doubts:-

Learn more about Python from an expert. Enroll in our Python Course

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Jul 2, 2019 in Python by Sammy (47.6k points)
0 votes
1 answer
asked Jul 22, 2019 in Python by Sammy (47.6k points)

Browse Categories

...