+ 1
the product of odd number from 0-20
am having a serious issue om how to write that instruction using
3 Answers
+ 4
Okay so you seem to be asking for the pseudocode:
0) set a variable "product" to 1
1) Iterate through 1 and 20
2) See if the number is not divisible by 2
3) If yes, multiply product by that number.
4) Print out the product.
+ 3
Another way would be to just set a for loop starting at 1 to iterate through every number until 20 with a step of 2 đ¤ˇââď¸
for i in range(1,20,2):
prod*=i
0
i appreciate you guys thanks