Python Forum
capitalize all letters
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
capitalize all letters
#1


hi. i have a text and i need to get all first letters/numbers of each word, capitalize and put a dot after each one.
the
text='''kldjsh sdfbdb dbsd 67 dshss'''
one=[x[0] for x in text.strip() ]
print(one)
with the above code i did manage to get the first letter of each word but i miss the upper case, the dot and a space after each word. some help please?
i tried
print(one.upper()) 
but it returns error.
Reply


Messages In This Thread
capitalize all letters - by atux_null - Dec-03-2017, 03:28 PM
RE: capitalize all letters - by Larz60+ - Dec-03-2017, 03:56 PM
RE: capitalize all letters - by atux_null - Dec-03-2017, 06:02 PM
RE: capitalize all letters - by buran - Dec-03-2017, 06:27 PM
RE: capitalize all letters - by atux_null - Dec-03-2017, 06:35 PM
RE: capitalize all letters - by buran - Dec-03-2017, 07:07 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Capitalize first letter of names in nested loops student_of_python 9 4,901 Oct-27-2019, 07:51 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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