Created
June 6, 2018 02:22
-
-
Save DonghoonPark12/da4d0a8d607811ea774dd58db990ae41 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#4 DashInsert | |
f = open("input.txt","r") | |
long = f.read() #문자열로 읽음 | |
#print(len(long)) | |
flag1 = 0 | |
flag2 = 0 | |
list = [] | |
for i in long: | |
list.append(i) | |
print(list) | |
backup = 0 | |
for i in list: | |
j=0 | |
if j !=0 and (int(i) % 2) ==0 and int(backup) % 2 == 0 : | |
list.insert(j, '*') | |
if j != 0 and (int(i) % 2) == 1 and int(backup) % 2 == 1: | |
list.insert(j, '-') | |
backup = i | |
j = j+1 | |
print(list) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment