-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy path1239.py
More file actions
27 lines (25 loc) · 698 Bytes
/
1239.py
File metadata and controls
27 lines (25 loc) · 698 Bytes
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
bold, italic = ["<b>", "</b>"], ["<i>", "</i>"]
while True:
try:
n,n1 = False, False
pal = input()
for i in pal:
if i == '*':
if n:
print(bold[1], end="")
n = False
else:
print(bold[0], end="")
n = True
elif i == '_':
if n1:
print(italic[1], end="")
n1 = False
else:
print(italic[0], end="")
n1 = True
else:
print(i, end="")
print()
except EOFError:
break