- 1
Comment me answer
How to make a input number into even in python
3 odpowiedzi
+ 6
Bikesh Sah ,
please make a sample with different input numbers, and what you expect as an output.
what numbers do you expect to get from input:
> inter number
> float number
> can input numbers also be negative?
+ 3
You could divide by 2, round or make it an integer, the multiply by 2. The double of any number will always be even.
int(num/2)*2
or
floor(num/2)*2
or
ceil(num/2)*2
+ 1
x = int(input()) , and pls search on google before asking try hard!