Advanced printing - end

Every time print() is used to print something, the next print() already prints from a new line. But in some cases, you might want to stay on the same line.
print('hello', 'everyone', end='...')
print('Anyone here?')
This program would print hello everyone...Anyone here?. So, instead of printing Anyone here? from a new line, the program stayed on the same line as end was set to ....
By default, the end parameter is set to \n, which is a special symbol that represents the new line. We will cover the special symbols and what they do later in the course. For now, we’ll cover only one - \n the new line symbol.
print('one', 'two', end='--')
print('three', 'four', end='!!!')
print('five', 'six', 'seven', end='\n')
print('eight', end='nine')
print('ten', end='... the end...')
This program would result in:
one two--three four!!!five six seven
eightnineten... the end...
Notice how end is different from sep. With the end parameter, we can modify what is printed at the very end of the printed output. With the sep parameter, we can modify how the printed values are separated from each other within the same print statement.


Use 12 print statements to print all the months in a year. At the end of each month, there should be a *-* except for the last one.
Here is the list of all months: January, February, March, April, May, June, July, August, September, October, November, and December.


Time limit: 2 seconds

Memory limit: 512 MB

Output limit: 1 MB

To check your solution you need to sign in
Sign in to continue