Answer:
import random
x = random.randrange(300, 400)
if x%2 == 0:
print(x, "is an even number")
else:
print(x, "is an odd number")
Step-by-step explanation:
The code is written in python
The question ask us to generate a random number and confirm if the generated number is an even number or odd number.
import random
This line of code is use to import the function random . The function is use to generate a random number.
x = random.randrange(300, 400)
The code generate a random number between the range 300 and 400.
if x%2 == 0:
If x(x is the generated random number) divided by 2 has no remainder the value is an even number.
print(x, "is an even number")
The code means print the generated number is an even number if the number is even.
else:
otherwise
print(x, "is an odd number")
The code means print the generated number is an odd number if the number is an odd number.