Answer the question
In order to leave comments, you need to log in
Output on one line (Python, task from Yandex Practicum): how to comply with the requirement of the task?
I am now going through the free part of the course at Yandex Practicum on Data Analytics.
I'm learning Python from scratch. In Course No. 3 in section No. 2 there is a task (topic "Output on one line").
Task:
The names of the columns that form the "header" of the table are stored in the header list. Display the "header" on the screen in this form:
| Title | EmojiXpress, mln | Instagram, mln | Twitter, mln |
Use a loop and the print() function for this without a line break.
Hint
Follow the algorithm described in the code snippet:
# first type one vertical bar
# < write code here >
for name in header:
# put a space
# < write code here >
# print another name from header
# < write code here >
# add another space and a vertical bar
# < write code here >
Don't forget to include the named argument end='' in every call to print().
My code:
header = ['Название', 'EmojiXpress, млн', 'Instagram, млн', 'Твиттер, млн']
print(' | ', end='')
for name in header:
print(name,'| ', end='')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question