-1
def thing():
    _list = [1,1,5,6,8,3,4,6,10,23,5,12,67,3,25,2,6,5,4,3,2,1]
    _list1 = [str(i) for i<=5 in _list]
    return " ".join(_list1)

print(thing())

Hello! The problem i am facing, I am trying to print put in a _list1 only integers elements that are lower than 5, I put all the elements in _list. Thank you!

1 Answers1

0
def thing():
    _list = [1,1,5,6,8,3,4,6,10,23,5,12,67,3,25,2,6,5,4,3,2,1]
    _list1 = [str(i) for i in _list if i <= 5]
    return " ".join(_list1)

print(thing())
Synthase
  • 5,849
  • 2
  • 12
  • 34