Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
3 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)

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:-

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)
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94k users

Browse Categories

...