8 ответов
+ 1
This is my attempt
https://code.sololearn.com/cKAcR8AXqZaU/?ref=app
+ 1
You could use a for- instead of a while-loop
+ 1
You can check It with a condition:
if i%2 == 0:
print("It is multiplicable to two")
else:
print("Isn't multiplicable to two")
Or for more especific:
for i in range(0,num):
if i%2 == 0:
print("It is multiplicable to two")
else:
print("Isn't multiplicable to two")
+ 1
Jairo Soto I think not, because the i is increasing and while It, We are moduling him by 2
So, Just think:
1/2 = 1 (It is not multiplicaple)
2/2 = 0 (It is multiplicaple)
...
It is just my logic 😅
+ 1
Jairo Soto Yes, but in this code, you canal only see a number (It is helpful sometimes) but you cannot define num's value by yourself
This is my attempt:
https://code.sololearn.com/cXwfg50FOA07/?ref=app
0
Puesto que tiende más a un problema matemático, supongo que mediante algoritmos de factorización.
0
Usa el bucle for y el module "%"
0
Cat do Chrome I think that "if num % i == 0" is better for this case. what do you think?