☰ Contents · Computing

Branching practice and the for loop

Lessons 40–41 · 2 lessons · M. R. Fayziyeva, D. M. Sayfurov, N. S. Xaytullayeva. Informatics and Information Technologies, Grade 9. “Nashriyot uyi Tasvir”, Tashkent, 2020
Answers are for parents and teachers.
1
Write the numbers given by range(0, 30, 6).
2
Write a loop that prints the odd numbers from 1 to 20 on one line.
3
n is typed. Write a program that prints the sum of the numbers from 1 to n (5050 for n = 100).
4
Print a 3-row triangle of stars (1, 2, 3 stars) using a for loop.