0
a =[ 1, 1, 2, 3, 5, 8, 19, 21, 34, 55, 89 ]
a = [1, 1, 2, 3, 5, 8, 19, 21, 34, 55, 89] and write a program that prints out all the elements ofthe list that are less than 3. a. Instead ofprinting the elements cne by one, make a new list that has all the elements less than i from this list in it and print out this new list. b. Write this in one line ofPython. c. Ask the user for a number and return a list that contains only elements from the original list a that are smaller than that number given by the user. https://code.sololearn.com/WhRLs8CBia3O/?ref=app https://code.sololearn.com/WT8tK0ENAZBp/?ref=app
4 Respostas
+ 2
Vishnu Muralidhar Why you shared others code if you want solution in python?
+ 1
a =[ 1, 1, 2, 3, 5, 8, 19, 21, 34, 55, 89
]
i = int(input())
x = [ x for x in a if x < i]
print(x)
0
I don't know to tag relevant thing to post