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()
A transcript must have a signature or school stamp.
Answer:
For question a, it simplifies. If you re-express it in boolean algebra, you get:
(a + b) + (!a + b)
= a + !a + b
= b
So you can simplify that circuit to just:
x = 1 if b = 1
(edit: or rather, x = b)
For question b, let's try it:
(!a!b)(!b + c)
= !a!b + !a!bc
= !a!b(1 + c)
= !a!b
So that one can be simplified to
a = 0 and b = 0
I have no good means of drawing them here, but hopefully the simplification helped!
Answer / Explanation:
195.200.0.0/16
Note: Class C address can not be assigned a subnet mask of /16 because class c address has 24 bits assigned for network part.
2ⁿ = number of subnets
where n is additional bits borrowed from the host portion.
2ˣ - 2 = number of hosts
where x represent bits for the host portion.
Assuming we have 195.200.0.0/25
In the last octet, we have one bit for the network
number of subnets = 2¹ =2 network addresses
number of host = 2⁷ - 2= 126 network addresses per subnets