Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Lists
#1
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
Reply
#2
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()]
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020