Skip to content

Instantly share code, notes, and snippets.

@DonghoonPark12
Created June 6, 2018 02:22
Show Gist options
  • Save DonghoonPark12/da4d0a8d607811ea774dd58db990ae41 to your computer and use it in GitHub Desktop.
Save DonghoonPark12/da4d0a8d607811ea774dd58db990ae41 to your computer and use it in GitHub Desktop.
#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