I have used regular expressions to parse a file and locate the name and price of the following currencies. Note that both of these items (x=name/y=price) inserted into lists. I have used a join statement on top of this:
print("\n".join(x + (y)))
"name":"Bitcoin"
"name":"Ethereum"
"name":"Tether"
"price":21335.75253
"price":1592.06118
"price":1.00015`
From here, I am trying to get the following display:
"name":"Bitcoin" - "price":21335.75253
"name":"Ethereum" - "price":1592.06118
"name":"Tether" - "price":1.00015`
The only way I can get the intended display, is by using the following:
print(x[0],y[0])
"name":"Bitcoin" "price":21335.75253
Ideally I can use a for loop inside both slices, but I'm not sure thats possible.