Detect the full number
Write a program that receives a number from the user and determines whether the number is complete.
(Help: A complete numeral to the sum of the amount of the amount against his (except himself) equal to himself)
Write a program that receives a number from the user and determines whether the number is complete.
(Help: A complete numeral to the sum of the amount of the amount against his (except himself) equal to himself)
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
num = input("Enter your number: ") print(True) if sum([i for i in range(1, int(num)) if int(num) % i == 0]) == int(num) else print(False)
n=int(input ('your number: ')) x=0 for i in range(1,n): if n%i==0: x+=i if x==n : print ('kamel ast') else: print('kamel nist')
try: num=int(input("number: ")) except: exit() i=num-1 mode_list=[] while i>0: if(num%i==0): mode_list.append(i) i-=1 sum=0 for item in mode_list: sum+=item if(sum==num): print("Kamel") else: print("Kamel Nist")
n=int(input('number:')) a=0 for i in range(1,n): if n%i==0: a=a+i else: pass print(a==n)
# The program that checks whether a complete number is def is_perfect_number(n): # Calculate the sum of the amount of the amount against the number (except the number itself) divisors_sum = sum(i for i in range(1, n) if n % i == 0) # Check whether the sum of the amount of the amount against the identity is equal to the number itself return divisors_sum == n # Get a number from the user number = int(input("یک عدد وارد کنید: ")) # Review and display the result if is_perfect_number(number): print(f"{number} یک عدد کامل است.") else: print(f"{number} یک عدد کامل نیست.")
while True : number = int(input("adad morede nazar ra vared konid : ")) r = list(range(1,number)) l = [] for x in r : if number % x == 0 : l.append(x) if sum(l) == number : print(l) break else : print("in adad kamel nist , lotfan adade digar vared konid")
number = int(input("adad bede bebinam kamele y na : ")) me = range(1,number) meh = [] for i in me: if number % i ==0: meh.append(i) x = 0 for m in meh: x +=m if x ==number: print(f"adade {number} kamele !") else: print(f"adade {number} kamel nist")
Submitting answers is currently unavailable.
Write a program that receives the user's name, age and city and print on output
Write a program that receives the number of random numbers and its interval from the user and produces the number of random numbers. Example: Enter A Number: 10 Enter Min: 1 Enter Max: 10 9 4 6 5 2 8 1 7 9 2 2
Write a program that receives the user's age from the input and checks that if the user was younger than 1, it would be a throw/raise error, otherwise print a welcome message
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام If you don’t understand the exercise or can’t solve it for any reason, that’s completely
normal—don’t worry 😊
Try checking out easier exercises and reviewing different answers
submitted by others. Gradually, you can move on to more challenging exercises. Also, your answer
might be correct even if it’s different from others.