by CodeChum Admin
Instructions:
Output
The squares and cubes of the elements in the array.
4
1
1
8
27
.
.
.
#Here you can input integers
input_list = [ 10, -21, 4, -33, 1, 22]
positive_count, negative_count = 0, 0
#creating loop and conditions
for num in l:
if num >= 0:
positive_count += 1 and positive_count^3
else:
negative_count += 1 and negative_count^2
#printing our output
print("Positive numbers in the list: ", positive_count)
print("Negative numbers in the list: ", negative_count)
Comments
Leave a comment