Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
List comprehension, join, split usage
#python 3.5.2 string1 = "6392079|||| 1.0|03/09/2017|PARADIGM REAL-TIME REVEL INSULIN INFUSION PUMP|INSULIN INFUSION PUMP / SENSOR AUGMENTED|MEDTRONIC MINIMED|18000 DEVONSHIRE STREET||NORTHRIDGE|CA|91325||US|91325||MMT-723LNAH|MMT-723LNAH|||0LP|R|01/29/2014|OYC||Y" keys = ["Report key", "Device sequence number", "Date received", "Brand name"]; values = [key.strip() for key in string1.split("|") if key.strip()]; output = "\n".join([key + str(value) for key, value in zip(keys, values)]); print (output);
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Contact Class
количество 1 и 0 в последовательности чисел до n
substring
(P3) Scrabble
snake water gam correct
Reverse number
models
https://rextester.com/OSAX55060
My Personal data
Sending email from python
Please log in to post a comment.