0

I need to paste all of my data on separate lines so that they arent all smashed together. This is my data:

    data = {'sku: ***'+sku0+'*** Size: ***'+size0+'*** Stock: ***'+stock0+'***'
    'sku: ***'+sku0+'*** Size: ***'+size1+'*** Stock: ***'+stock1+'***'
    'sku: ***'+sku0+'*** Size: ***'+size2+'*** Stock: ***'+stock2+'***'
    'sku: ***'+sku0+'*** Size: ***'+size3+'*** Stock: ***'+stock3+'***'
    'sku: ***'+sku0+'*** Size: ***'+size4+'*** Stock: ***'+stock4+'***'
    'sku: ***'+sku0+'*** Size: ***'+size5+'*** Stock: ***'+stock5+'***'
    'sku: ***'+sku0+'*** Size: ***'+size6+'*** Stock: ***'+stock6+'***'
    'sku: ***'+sku0+'*** Size: ***'+size7+'*** Stock: ***'+stock7+'***'
    'sku: ***'+sku0+'*** Size: ***'+size8+'*** Stock: ***'+stock8+'***'
    'sku: ***'+sku0+'*** Size: ***'+size9+'*** Stock: ***'+stock9+'***'}
Taku
  • 31,927
  • 11
  • 74
  • 85
lizzie hopkins
  • 47
  • 2
  • 2
  • 4

2 Answers2

0

if you want to format the output you can use \n wherever you need the output to go to a newline.

data = {'sku: ***'+sku0+'*** Size: ***'+size0+'*** Stock: ***'+stock0+'***\n'

if you want to format the code I would suggest using a variables holding each line and then use + to add all of them together

Patrick Haugh
  • 59,226
  • 13
  • 88
  • 96
theautodev
  • 16
  • 2
0

If you include '\n' in a string, it will split the line there. For instance:

print('This is the first line\nAnd this is the second line')

Then the output would be:

This is the first line
And this is the second line
hopethatsacleanwet
  • 418
  • 1
  • 4
  • 13