Assigning a value for the for loop | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Assigning a value for the for loop

Can I assign a character to each unit printed in the "for" loop?

21st Mar 2017, 5:55 PM
Batuhan
Batuhan - avatar
1 Answer
0
Now I want to say two numbers called a and b, and I want the number of terms. When the program runs, it will print from 1 to the number of terms, but print the numbers that are exactly divisible to a or b. I can not use an if for a certain number because the value that the user will input will change constantly. So when I print the pattern, I want the 3rd term, but the 3rd term will change according to the values entered by the user. How can I do that ?
22nd Mar 2017, 1:04 PM
Batuhan
Batuhan - avatar