RA2411027010 Python
RA2411027010 Python
In python code:
sum_of_divisors = 0
sum_of_divisors += i
def find_perfect_numbers(limit):
print(f"Perfect numbers up to {limit} are:")
find_perfect_numbers(limit)
Explanation of Failure:
The input() function reads input as a string. When you entered 6,60, it read it
as a string, and the int() function cannot convert a string with a comma into an
integer.
The program expects a single integer value as input, but your input format was
incorrect.
maximum = max(numbers)
minimum = min(numbers)
return maximum, minimum
# Input values
try:
Explanation of Failure:
The output indicates an "Invalid input" message because the user entered
non-integer values ("y u"). In the code, the map(int, input(...).split()) line
attempts to convert each input value to an integer. Since "y" and "u" cannot
be converted to integers