on the truth is that the walls
Answer:
fraction = input("enter fraction x/y: ")
if len(fraction) == 3:
if fraction[1] == "/":
try:
num = int(fraction[0])
den = int(fraction[2])
if num < den:
print(f"{num}/{den} is a proper fraction")
else:
if num% den == 0
print(f"{num}/{den} is an improper fraction and can be reduced to {num/den}")
else:
print(f"{num}/{den} is an improper fraction and can be reduced to {num//den} + {num - (den * (num//den))}/{den}")
except ValueError:
print("numerator and denominator must be integer numbers")
Explanation:
The try and except statement of the python program is used to catch value error of the input fraction of values that are not number digits. The program converts the numerator and denominator string values to integers and checks for the larger value of both.
The program prints the fraction as a proper fraction if the numerator is lesser and improper if not.
Answer:
Explanation:
Let's do this in python
(a) Between 5 and 60 and divisible by 5
for i in range(5, 60/5):
print(5*i)
(b) Less than 200 and divisible and 2 and 7
for i in range(1, int(200/14) + 1):
print(14*i)
(c)Sum of multiple of 8 that are between 100 and 500
sum_result = 0
for i in range(100, 500):
if i % 8 == 0:
sum_result += i
print(sum_result)
(d)sum of all odd numbers between 20 and 10
sum_odd = 0
for i in range(10, 20):
if i % 2 == 1:
sum_odd += i
print(sum_odd)
Answer:
The comparison is done based on their basic, principle, plaintext, key size, rounds, rounds name, security and speed. See the attached document.
Explanation:
The the attachment