I need help fixing my code for Syntax errors in Python.
def display_larger(numberList, num):
...
Computers and Technology, 11.04.2021 09:30 kell22wolf
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)
Answers: 3
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
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
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
Mathematics, 15.01.2021 19:50
Physics, 15.01.2021 19:50
Mathematics, 15.01.2021 19:50
Mathematics, 15.01.2021 19:50
Mathematics, 15.01.2021 19:50
Mathematics, 15.01.2021 19:50