subject

I need help fixing my code for Syntax errors in Python. def display_larger(numberList, num):
greaterList=[]
for i in range(len(numberList)):
if numberList[i] > num:
greaterList. append(numberList[i])

return greaterList
def main():
print("\nEnter a list of 10 integers:")
numberList = []

for i in range(0, 10):
print("Enter number a number: ")
item = int(input())
numberList. append(item)

return numberList

if __name__ == "__main__":
numberList=main()
num=int(input("Enter the number you wish to test if the list elements are greater than: "))
print("Number: ",num)
print("List of numbers:\n",numberList)
newList=display_larger(numberList, num)
print("List of numbers that are larger than ",num)
print(newList)

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 15:20, yeahmaneee
What does a bonus object do? a. subtracts lives b. keeps track of a player's health c. gives a player an advantage d. makes text appear
Answers: 1
image
Computers and Technology, 24.06.2019 05:30, MOONCHILDSUGA
If you combine two cells into one, what action are you performing? a.  adding a new row or column      b.  splitting the cells      c.  removing a new row or column      d.  merging the cells
Answers: 2
image
Computers and Technology, 24.06.2019 17:30, mariahdelossantos031
Which computer network component connects two different networks together and allows them to communicate? a is a node (or a device) that connects two different networks together and allows them to communicate.
Answers: 2
image
Computers and Technology, 24.06.2019 22:30, juicyx39
In writing a paper for his english class, gavin quoted an author of the book. what should he include in his paper to credit the source? citation caption header entry
Answers: 1
You know the right answer?
I need help fixing my code for Syntax errors in Python. def display_larger(numberList, num):
...

Questions in other subjects:

Konu
Mathematics, 15.01.2021 19:50
Konu
Mathematics, 15.01.2021 19:50
Konu
Mathematics, 15.01.2021 19:50