Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with open(r'C:\Pyton\dataset_3363_2.txt') as inf:
- stroka=inf.readline()
- chislo=''
- for x in range(len(stroka)):
- if stroka[x].isdigit():
- chislo+=stroka[x]
- if x==(len(stroka)-1):
- print(bukva*int(chislo), end='')
- break
- if stroka[(x+1)].isalpha():
- print(bukva*int(chislo), end='')
- chislo=''
- elif x==(len(stroka)-1): print(bukva*int(chislo), end='')
- else:
- bukva=stroka[x]
- stroka='q7B11r11B8g19M11F20h9s4E9Q19S13E18Z19A1h14V17Z17S5p12z12H10v13a13n5h19C6n20V7'
- print(len(stroka))
- chislo=''
- for x in range(len(stroka)):
- if stroka[x].isdigit():
- chislo+=stroka[x]
- if x==(len(stroka)-1):
- print(bukva*int(chislo), end='')
- break
- if stroka[(x+1)].isalpha():
- print(bukva*int(chislo), end='')
- chislo=''
- elif x==(len(stroka)-1): print(bukva*int(chislo), end='')
- else:
- bukva=stroka[x]
- stroka="20V7" <=== ошибку пишет тут
- print(len(stroka))
- chislo=''
- for x in range(len(stroka)):
- if stroka[x].isdigit():
- chislo+=stroka[x]
- if x==(len(stroka)-1):
- print(bukva*int(chislo), end='')
- break
- if stroka[(x+1)].isalpha():
- print(bukva*int(chislo), end='')
- chislo=''
- elif x==(len(stroka)-1): print(bukva*int(chislo), end='')
- else:
- bukva=stroka[x]
- SyntaxError: multiple statements found while compiling a single statement
- >>>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement