Print Each Character
Print each character on new line.
BeginnerPhase 5 - Category 2: Character OperationsExample 3 of 10
print-each-character.py
1# Take string input2s = input("Enter a string: ")34# Print each character5for char in s:6 print(char)
Output
Enter a string: Hello H e l l o
What's going on
Iterate through string characters.
Key Concepts:
Loop through string
Each iteration gives one character
Print each character
🔗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