fb pixel

Advanced printing - sep

So far, we’ve used print() statements with different arguments, and the program printed those separated by a space. print('abc', 'def', 2) would result in abc def 2.
What if we want to separate the values with a * instead of a space. This is possible by providing a sep parameter to print().
print('hello', 'my', 'name is', 'Python', sep='*')
This program would print hello*my*name is*Python. sep can be any textual value. It can be a phrase (this is a separation, hey hey, etc), it can consist of symbols, and it can even be an empty text sep=''. In the case of an empty text, print would output the values concatenated to each other.
print('hello', 'my', 'name is', 'Python', sep='')
dash = '--'
print('hello', 'my', 'name is', 'Python', sep=dash)
This would result in:
hellomyname isPython
hello--my--name is--Python


You are given 3 inputs - a year, a month, and a day. You need to output the date in the format year-month-day.
2022 05 10
To check your solution you need to sign in
Sign in to continue