5596/how-print-first-character-each-word-upper-case-string-python
Lets say there is a string such as "this is a sample python program".
How to write a program such that it would print the first character of each word in the string. such as T,I,A,S,P,P
i.e. This Is A Sample Python Program ?
Hey,
You can try this:
Use .join():
print(" ".join([item1, item2]))
The default for print, however, is to put a space between arguments, so you could also do:
print(item1, item2)
I hope this will be helpful.
By using the .title() method of string ...READ MORE
The .title() method of a string (either ASCII or ...READ MORE
If you are talking about the length ...READ MORE
following way to find length of string x ...READ MORE
Python strings are immutable, you change them ...READ MORE
You can also use the random library's ...READ MORE
Syntax : list. count(value) Code: colors = ['red', 'green', ...READ MORE
Enumerate() method adds a counter to an ...READ MORE
You can simply the built-in function in ...READ MORE
You can use word.find('o') as well to ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.