so, the thing is i want to get largest prime factor of a very big number. i know this is probably correct but it has so many loops and conditional statements. i want to basically improve this but don't know how to? n = int(input("Enter the value: ")) max = 0 i =1 def prime(i): count = 0 for j in range(1,i+1,1): if i % j== 0: count+=1 if count == 2: return 1 else: return 0 #this while loop checks upto value n while i < n: if prime(i) and n % i == 0 and max < i: max = i else: i +=1 print(max) input: 600851475143 output: #i should get largest prime factor for this but not showing any output btw this is not related to above question what do i do to write good code(i am an absolute beginner) Continue reading...