Python Forum
capitalizing words in list
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
capitalizing words in list
#1
# [ ] split the sentence, code_tip, into a words list
# [ ] print the joined words in the list with no spaces in-between
# [ ] Bonus: capitalize each word in the list before .join()
code_tip ="Read code aloud or explain the code step by step to a peer"

my code:
code_tip = "Work hard and believe in yourself."
wl = code_tip.split()
print(''.join(wl))
Don't know how to capitalize each word in the list before .join(). I tried with .str() but it gives error: AttributeError: 'list' object has no attribute 'str'
Reply


Messages In This Thread
capitalizing words in list - by Truman - Feb-19-2018, 11:04 PM
RE: capitalizing words in list - by Larz60+ - Feb-19-2018, 11:40 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Duplicated words in a list pooyan89 7 9,375 Jun-15-2019, 08:21 PM
Last Post: perfringo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020