Computer Science, asked by vamritaeunameun, 1 year ago

Write a Python program to check whether your number is equals to 1000 or not?
_________ PLEASEE I NEED QUICK AND QUALIFIED ANSWER_________

Answers

Answered by AbhijithPrakash
2
  1. def perfect_number(n):
  2.    sum = 0
  3.    for x in range(1, n):
  4.        if n % x == 0:
  5.            sum += x
  6.    return sum == n
  7. print(perfect_number(1000))

Hope this Helps You...

Please Correct me If I'm Wrong...


vamritaeunameun: it's not showing correct dear
AbhijithPrakash: are you using python 3.7.2
AbhijithPrakash: ??
vamritaeunameun: no
vamritaeunameun: i'm using python 2.7
AbhijithPrakash: What error was it showing??
vamritaeunameun: It wasn't accepting it
vamritaeunameun: Well... leave it! My work has been already done ^-^
Answered by paroshnee18
1

Answer:

def near_thousand(n):

     return ((abs(1000 - n) <= 100) or (abs(2000 - n) <= 100))

print(near_thousand(1000))

print(near_thousand(900))

print(near_thousand(800))    

print(near_thousand(2200))

pls mrkas brainlist


AbhijithPrakash: This is Wrong
AbhijithPrakash: this is to test whether a number is within 100 of 1000 or 2000
Similar questions