|
Oktatás * Programozás 1 * Szkriptnyelvek Teaching * Programming 1 (BI) Félévek Linkek * kalendárium |
Nim2 /
for loopfor i in 1..5: echo i 𝥶Closed interval. 5 is included. It prints the following values: 1, 2, 3, 4, 5 for i in 1 ..< 5: echo i 𝥶The interval is open on the right side. 5 is not included. Printed values: 1, 2, 3, 4 It's like Python's In Nim, countup()You need a step and you want values in increasing order. The task is to print these values: 2, 4, 6, 8
countdown()You need a step and you want values in decreasing order. The task is to print these values: 10, 8, 6, 4, 2
Notice that the step is always positive! Even if you use |
![]() Blogjaim, hobbi projektjeim * The Ubuntu Incident [ edit ] |
||||||||