Python Forum
Lists - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Homework (https://python-forum.io/forum-9.html)
+--- Thread: Lists (/thread-6426.html)



Lists - RiceGum - Nov-21-2017

I just started lists and i'm having a very hard time, i need a program that reads a list and two values(superior and inferior) then it prints the values of the list in the interval [inferior,superior]
list = []
list = (eval(input()))
inferior = float(input())
superior = float(input())
I'm sorry i haven't got far a long with the code i just really don't know. I know i might have to use a while cicle but how? Any suggestions please


RE: Lists - Larz60+ - Nov-21-2017

first, don't name it list as that is a python object name.
mylist = [float(x) for x in input('Enter floating point items separated by single space: ').split()]