Printing Lists


When you have a list like:
numbers = [5, 6, 7, 8]
How do tell the code to print index 0 and 1 and not add them instead?

print numbers[0] + numbers[1]
This command adds the numbers together but how do I tell the code to just print “5 6”?


you can use , instead of + sign

also you can use one more print statement to print the second value at next line.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.