Can you please write this in python Thank you.
Consider a list called A: A = [-6, 10, 100, 5, -20, 1000, 9, -15]
Make a for loop that iterates over A and:
Answer:
Code:
A=[-6, 10, 100, 5, -20, 1000, 9, -15]
for i in A:
if(i<0):
print(i*i)
elif(i>0 and i<=100):
print(i)
elif(i>0 and i>100):
print("0")
Output:
Indentation:
.
Get Answers For Free
Most questions answered within 1 hours.