+ 2
Hey everyone i make code about #SuperperfectNumber but it doesn't work can anyone of you help me!
25 Answers
+ 3
yes, for example, depend in which number you want to begin. Obviously it is depend of problem to resolve
+ 7
In your loop you are checking for a condition n%i and you iterate starting from 0. This is why you get a ZeroDivision error - you can't divide by 0.
Try with changing the range start to 2 (no point in checking for %1 as it's always 0).
+ 4
what is the problem? share your code
+ 4
You said "anymore". You mean it even worked?
+ 3
i=int what is it?
+ 3
Its not correct. You must to initialize with a value because inmediatily next to it you are using the variable in while condition
+ 3
@Beautiful mind could you comment each coding line? I think something is wrong yet
+ 3
I think is wrong yet. You are coding to check if a number is superperfect but you dont use sentences in correct way. If you check any number not always work, not always while finish so it is a huge problem
+ 3
You must to change i increment
+ 3
You are welcome ;-)
+ 2
Yeah that you very much ๐๐
+ 2
but it doesn't work.. ๐
+ 2
like i=1?
+ 2
upiii now it works
thank u very much and now i know what was wrong with it ๐๐
+ 2
Also, @Beautiful Mind I think you are wrong about what is a superperfect number. Look at this
Challenge: superperfect numbers
in mathematics, superperfect numbers are numbers matching the following criteria:
sum of dividers of n is d and sum of dividers of d is n*2.
to make an example, 4 is a superperfect number, as 4's dividers are 1,2,4. 1+2+4= 7, and 7's dividers are 1,7. notice as 1+7=8 (4*2)
in short, 4 => 1+2+4= 7 => 1+7 = 8 = 4*2.
task: write a code to find all the superperfect numbers from 1 to x (code should provide explanation) in any language you prefer
+ 2
So you must to do the same 'while' with first result m and next yes, compare but new m with n*2
+ 2
https://code.sololearn.com/c4f4zdOZZ05v/?ref=app
Check that ;-)