def is_list_even(my_list):
for i in my_list:
if(i%2 != 0):
return False
return True
def is_list_odd(my_list):
for i in my_list:
if(i%2 == 0):
return False
return True
def main():
n = int(input())
lst = []
for i in range(n):
lst.append(int(input()))
if(is_list_even(lst)):
print('all even')
elif(is_list_odd(lst)):
print('all odd')
else:
print('not even or odd')
if __name__ == '__main__':
main()
Answer:
java: error
C: false
Explanation:
In Java the compiler understand that you are trying to compare an integer (15) with a boolean (10 > 5) this generate the next error:
error: bad operand types for binary operator
In C the compiler convert (15 > 10 > 5) in (15>10) > (10>5) which is equal to TRUE > TRUE, the compiler can also read it as 1 > 1 (since 1 is TRUE and 0 is FALSE). like 1>1 is false then C program return false.
Answer:
none of them
Explanation:
the resistor is connected to the + pole of the battery, no circuit shows that.
a 1kΩ resistor would be brown-black-red, not brown black black.
Answer:
The representation of 100.0 in the floating-point representation is computed as follows: First convert the given number 100.0 in the binary form. 10010 = 11001002 the binary representation.
Explanation: