how do i write a program that makes a weird line of words like
hI i nEEd HELP
and change it to Hi I Need Help
this is what you need to have your words capitalized correctly
a = 'hI i nEEd HELP'
b = ' '.join(i.capitalize() for i in a.split(' '))
All you need to figure out is how to get the weird line and put it in a and then how to print b.
Do a google search for "Python Regular Expressions"
Copyright © 2024 Q2A.ES - All rights reserved.
Answers & Comments
Verified answer
this is what you need to have your words capitalized correctly
a = 'hI i nEEd HELP'
b = ' '.join(i.capitalize() for i in a.split(' '))
All you need to figure out is how to get the weird line and put it in a and then how to print b.
Do a google search for "Python Regular Expressions"