Answer:
see description
Explanation:
clicking in new script, we type the following:
%inputs and variables
N = input('Enter N : ');
values = input('Enter values : ');
positive=0;
negatives=0;
zero=0;
%for loop
for c = 1:N
if values(c) > 0
positive = positive + 1;
elseif values(c) < 0
negatives = negatives + 1;
else
zero = zero + 1;
end
end
positive
negatives
zero
so we basically loop the array and add one to counters each time we read an element from the input, for example if we enter:
Example input
Enter N : 5
Enter values : [1,-1,0,2,352]
positive = 3
negatives = 1
zero = 1
Answer:
The expression on line 9 required 2 brackets
Explanation:
Given
The attached code
Required
Why syntax error.
The error points to line 10, but the error is actually from line 9
To get an integer input, the syntax is:
variable-name = int(input("Prompt"))
From the attached code, the line 9 is:
amount = int(input("Enter cheese order weight: ")
By comparing the syntax to the actual code on line 9, only 1 of the brackets is closed.
<em>This, in Python 3 is a sytax error</em>
Safest way: DO NOT reply and BLOCK number.
If you are not sure if the guy is related to some stuff, it will be better to call him back, instead of texting.