Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Reading XML file to modify
#python 3.5.2 lines = '''<entry rowname="1">a</entry> <entry rowname="1">a</entry> <entry rowname="2">b</entry> <entry rowname="2">b</entry> <entry rowname="2">b</entry> <entry rowname="3">c</entry> <entry rowname="3">c</entry> <entry rowname="4">d</entry> <entry rowname="5">e</entry> <entry rowname="5">e</entry>''' last_num = "" lines = lines.split("\n") for i, line in enumerate(lines): arr = line.split('"') if arr[1] != last_num: lines[i-1] = lines[i-1] + "TEXT" last_num = arr[1] print("\n".join(lines))
run
|
edit
|
history
|
help
0
benda x guna
2.1.19
Convert list into set
Find common characters between two strings
Sri rama
Lesson#6
Itertools-Cartesian-Product-var-args
0-1 Knapsack
add through function
An attempt at making an encrypting algo in Python.