For loop | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

For loop

How would I write a for loop that once a number is divisible by 3 it would print hello instead of the number?

10th May 2019, 4:00 PM
Jarom
Jarom - avatar
3 Answers
+ 3
If(number%3==0) print "hello"
10th May 2019, 4:07 PM
Werg Serium
Werg Serium - avatar
+ 2
Make a if inside the for
10th May 2019, 4:06 PM
Werg Serium
Werg Serium - avatar
+ 1
thank you!!
10th May 2019, 4:07 PM
Jarom
Jarom - avatar