here is a list of numbers. -45,-21,-16,12,33,40 a) write down two numbers from the list that add up to -9
Answers
Answered by
5
Answer:
n=(int(input("Enter how many numbers you want to enter: "))
# initialize empty lists
arr=[]
positive=[]
negative=[]
for i in range(n):
number=int(input())
arr.append(number)
for i in range(n):
if arr[i]>=0 :
#if number is positive or zero than add it list
positive.append(arr[i])
else:
#if negative add to negative list
negative.append(arr[i])
print("All positive numbers = ",positive)
print("All negative numbers = ",negative)
print("All numbers = ",arr)
Step-by-step explanation:
tq
Answered by
11
Answer:
Hey mate
Here your answer
Solution
A) -21 +16 = -9
C)-45+(-21)+(-16)+12+33+40 = 3
Step-by-step explanation
Similar questions