Write a program that reads an integer N and then read N real numbers, separating the smallest and largest, presenting them on the screen.
N = int(input("Digite N: "))
i = 0
ma = 'maior'
me = 'menor'
me = x
while i < N:
x = float(input("Digite um número: "))
ma = x
me < ma
i = i + 1
if x > ma:
ma = x
if x < me:
me = x
print ('O maior valor digitado foi {} e o menor foi {}'.format(ma,me))
In the program, the user is asked to enter an integer value N and then read N real numbers and thus show the lowest and highest value among them. The question is what am I doing without using the list method. (beginner programming.) This code works on some tests, but on others it does not. I know the problem is in the declaration of variables or in the conditions of the if functions. But I can not see these errors.