Solo Learn (Python for Beginners): Leaderboard

Strings

You need to make a program for a leaderboard.
The program needs to output the numbers 1 to 9, each on a separate line, followed by a dot:
1.
2.
3.


You can use the \n newline character to create line breaks, or, alternatively, create the desired output using three double quotes “””.

Solution 1: As you can see we used (“”” “””) for multiple block of prints in the code.

Solution 2: Actually even in C++, ” \n “ means next line or new line, therefore you can use (” “) enclosed in it are the desired words you wanted to print. see examples above.

P.S. We really discourage copy pasting solutions, what we encourage is the understanding of why the code works instead of memorizing it.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s