[codeforces] A. Word Capitalization알고리즘(Python,Java)2019. 8. 24. 17:51
Table of Contents
반응형
problem
Capitalization is writing a word with its first letter as a capital letter. Your task is to capitalize the given word.
Note, that during capitalization all the letters except the first one remains unchanged.
Input
A single line contains a non-empty word. This word consists of lowercase and uppercase English letters. The length of the word will not exceed 103.
Output
Output the given word after capitalization.
Using language : python3
from string import ascii_lowercase
letter = list(ascii_lowercase)
user_input = list(input())
def prt(input_Str):
answer = ""
for prt in input_Str:
answer += prt
return answer
if user_input[0] not in letter:
print(prt(user_input))
else:
user_input[0] =user_input[0].upper()
print(prt(user_input))
반응형
'알고리즘(Python,Java)' 카테고리의 다른 글
[codeforces] A. Boy or Girl (1) | 2019.11.22 |
---|---|
[codeforces] A. Beautiful Matrix (0) | 2019.08.26 |
[codeforces] A. Helpful Maths (0) | 2019.08.24 |
[codeforces] A. Football (0) | 2019.08.24 |
[codeforces] A. Petya and Strings (0) | 2019.08.22 |
@IT grow. :: IT grow.
#IT #먹방 #전자기기 #일상
#개발 #일상