How to change lists in Python 3.X
📁 список, python
There is a text file with this content d * 11 = DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD Code below:
import rec = [] d = [] result = 0 with open ( '' dest.txt ', ' `) as s: for line in s: line.strip () lst = re.split ( '(\ d*)' , line) for i in lst: if> i.isalpha () == true : c.ppend (i) else : d.append (i) for a, b in zip (c, d): result += a*b print (result) result:
D: \ Python \ LIB \ Re.PY: 212 : futurewaing: split () Requires a non-empty Patte Match . retu _ compile (Patte, Flags) .Split (string, maxsplit)---------------------------------------------------------------------------TypeError Traceback (most recent call Last) & lt; ipython- input - 22 -24c875dcd30e & gt; in & lt; module & gt; () 16 17 for a, b in zip (c, d): --- & gt; 18 result += a*bren 19 20 print 'T Multiply Sequence byn -int of Type'
st r' Ответов пока нет.
Войдите чтобы оставить ответ