Answer: a. None
Explanation:
The loop will not run as the condition always returns false.
i=10 and the condition given: i<10 which is false always. So, the loop will not run.
Answer:
#Create an array for week
week = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday","Sunday"]
#Create a varable index and use index to loop through week(array)
for index in week:
#if the index is on Saturady or Sunday then, print freedom
if index == "Saturday" or index == "Sunday":
print(index + " Freedom")
#else just pint out the other days
else:
print(index)
Answer:
- def c_to_f(celsius):
- return celsius * 9/5 + 32
-
- temp_c = float(input('Enter temperature in Celsius: '))
- temp_f = None
-
- temp_f = c_to_f(temp_c)
- print('Fahrenheit:' , temp_f)
Explanation:
The first piece of code we can fill in is the formula to convert Celsius to Fahrenheit and return it as function output (Line 2).
The second fill-up code is to call the function c_to_f and pass temp_c as argument (Line 7). The temp_c will be processed in the function and an equivalent Fahrenheit value will be returned from the function and assigned it to temp_f.
Answer:
192.168.228.0 255.255.255.224
Explanation:
192.168.228.0 255.255.255.128
subnet mask: defines the host and the network part of a ip
CIDR notation : is the shortened form for subnet mask that uses the number of host bits for defining the host and the network part of a ip
For example: 192.168.228.0 255.255.255.128 has CIDR equivalent of 192.168.228.0\25
To have atleast 20 hosts
20 ≤ (2^x) -2
x ≈5
with 5 host bits, we have 2^5-2 = 30 hosts per subnet
and 2^3 = 8 subnets
To get the subnet mask, we have 3 network bits
1110000 to base 10 = 2^7 + 2^6 +2^5= 224
192.168.228.0 255.255.255.224