You need to make a program for a leaderboard. The program needs to output the numbers 1 to 9, each on a separate line, | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
- 1

You need to make a program for a leaderboard. The program needs to output the numbers 1 to 9, each on a separate line,

Can anyone help , Output must be 1. 2. 3. 4. . . 9.

24th Jun 2021, 5:38 PM
Lavesh Lingayat
3 Respuestas
0
for i in range(1, 10): print(i)
24th Jun 2021, 5:42 PM
Yahel
Yahel - avatar
0
C# int i = 1; while(i <= 9){ Console.WriteLine(i); i++; } }
24th Jun 2021, 5:55 PM
JRAMAHES
JRAMAHES - avatar
0
here is an example with some explanation of the code that might work. def leaderboard(n): # function to loop through range and print each line one by one for x in range(n): # loop range string=f"{x+1}." # create string print(string) # print leaderboard line if __name__=="__main__": x=10 # number for leaderboard leaderboard(x) # run leaderboard function https://code.sololearn.com/cPWiAycA5jLK/?ref=app edit: i am created a function, but thats not really needed. this is just one way to write it.
24th Jun 2021, 5:57 PM
you are smart. you are brave.
you are smart. you are brave. - avatar