-
Notifications
You must be signed in to change notification settings - Fork 0
/
P16205.py
46 lines (45 loc) · 1.18 KB
/
P16205.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
type, str = map(str, input().split(' '))
if type == "1":
print(str)
for s in range(len(str)):
if s != 0 and str[s].isupper():
print("_", end='')
print(str[s].lower(), end='')
else:
print(str[s], end='')
print()
new = str[0].upper() + str[1::]
print(new)
elif type == "2":
for s in range(len(str)):
if str[s] == "_":
continue
if str[s - 1] == "_":
print(str[s].upper(), end='')
else:
print(str[s], end='')
print()
print(str)
for s in range(len(str)):
if s == 0:
print(str[s].upper(), end='')
else:
if str[s] == "_":
continue
elif str[s-1] == "_":
print(str[s].upper(), end='')
else:
print(str[s], end='')
elif type == "3":
new = str[0].lower() + str[1::]
print(new)
for s in range(len(str)):
if s == 0:
print(str[s].lower(), end='')
elif str[s].isupper():
print("_", end='')
print(str[s].lower(), end='')
else:
print(str[s], end='')
print()
print(str)