Convert to Lowercase
Convert text to lowercase with Python lower. Students trace the returned string, unchanged digits, and why changing case does not validate or clean text.
1# Take string input2s = input("Enter a string: ")34# Convert to lowercase5lower_str = s.lower()6print(f"Lowercase: {lower_str}")
Output
Enter a string: HELLO Lowercase: hello
In this one
- Normalize lowercase text
- Retain nonletters
- Separate conversion from validation
How it works
- 1
Read the response as text.
- 2
Call s.lower() and save the result.
- 3
Print lower_str.
Edge cases
What does empty input produce?
What does empty input produce?
An empty lowercase result.
Are spaces removed?
Are spaces removed?
No. Their positions stay present.
What's going on
lower returns a new string with lowercase mappings. The result is stored separately from s before printing.
For HELLO 2, the output text is hello 2. Numbers and ordinary punctuation are not removed. Lowercasing can help normalize English comparisons, but does not validate words or remove accents; Unicode case handling can require more care for broader matching tasks.
What does empty input produce? An empty lowercase result.
Are spaces removed? No. Their positions stay present.
Quiz
Tap an option. The answer stays hidden until you pick.
Question 1
Does lower alter the source string?
Pick an answer to check it.
Question 2
What does empty input produce?
Pick an answer to check it.
Questions people ask
What does empty input produce?
An empty lowercase result.
Are spaces removed?
No. Their positions stay present.
Does lower alter the source string?
No.
๐Related Content
- ๐
Phase 5 - Learn Concepts
Review Phase 5 concepts and explanations
- ๐
Phase 5 - Quiz
Test your Phase 5 understanding with quiz questions
- ๐ป
Phase 5 - All Practice Problems
Explore all practice problems for Phase 5
- ๐
Master Your Logic Building - Complete Course
Browse all phases and tutorials
- ๐ง
Logic Building Overview
Learn about the complete logic building curriculum