Run Code
|
API
|
Code Wall
|
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
Country Flags
Skillenza - Marker Count
problem
Gift_Card Interview SQL Analysis Conducted by Miranda Zhao
Code
python, Polymorphie, attributes, setter and getter the pythonic way (V3)
Find numbers with given sum of digits
Random module
Homework exercise
Python, filter emails using finditer()