0

Python

How to write a python program? Given a natural number n, find the largest odd divisor of this number that is not equal to n

5th Nov 2019, 9:05 PM
Влад Голованов
Влад Голованов - avatar
5 odpowiedzi
+ 2
n = int(input()) print(max(i for i in range(1, n) if not n % i))
6th Nov 2019, 6:10 AM
David Ashton
David Ashton - avatar
+ 1
Turn n into a list of its factors and get the largest factor, that is not equal to n.
5th Nov 2019, 9:15 PM
Seb TheS
Seb TheS - avatar
0
Can you help me ?
5th Nov 2019, 9:33 PM
Влад Голованов
Влад Голованов - avatar
0
Влад Голованов I know how to create program to do that.
5th Nov 2019, 9:34 PM
Seb TheS
Seb TheS - avatar
- 1
could you write this program for me?
5th Nov 2019, 9:35 PM
Влад Голованов
Влад Голованов - avatar