It has the value 1111 1000 0110 0011 in base 2
What is 0xF863 in binary?
OR
What is 0d63587 in binary?
This logic gate is only true if both inputs are different
What is the XOR gate?
A local variable is used in a function's definition.
What is a parameter?
This construct is used when you want to iterate through a set of numbers, characters in a string, or a list.
What is a for-loop?
If the string bob = "Steve", the answer would be "v"
What is the output of bob[3]?
It is stored as a set of pixels. Each pixel has a numerical value representing the shade or colour of a square within the larger grid.
How are pictures stored on a computer?
This many inputs generate 16 different possible outputs or states.
How many outputs do you get with 4 inputs?
These are the four basic data types in Python that store a single "value".
What are integers, floating-point, boolean and Strings
n = input()
i = 1
while i < n:
if n % i == 0:
print("not special")
break
i += 1
if i == n:
print("special number")
What is the code for determining if a number is prime?
Outputs all the letters of a string with spaces between them and on the same line.
What is the output of the following program?
for c in myString:
print(c, end=" ")
For a signed binary number, its largest value is +7
What is the largest value that is stored as a 4-bit signed number?
The single logic gate is functionally equivalent to inverting both inputs, using an OR gate and then inverting the output again.
What is the output of an AND gate?
You can have the first one only once, which must be at the beginning. The second one is optional and can happen many, many times. The last one is optional but occurs at most once and at the end. It's an important decision to make.
What are the rules for if-elif-else in Python?
The result of this program if given the value 5 is:
1 4 9 16 25
If given 3, it is:
1 4 9
What is the output of:
n = input()
for i in range(n):
print(i**2, end=" ")
Outputs the last two letters in a String.
What is the output of myString[-2:]?
It is a type of error with binary calculations because the result is larger than what can be stored in the required number of bits.
What is overflow?
The result of this equation can be represented with this circuit diagram
What is the circuit diagram for Y = (A nand B) and B and not C?
This is the positive root for the quadratic formula written as a Python expression
What is the following expression?
x = (-b + math.sqrt(b**2 - 4*a*c))/(2*a)
Generates the list 20, 17, 14, ...,-4
What is generated by range(20, -5, -3)?
If we assume the number of characters is odd, it outputs the middle three characters of a string.
What is the output of:
mid = len(myString)//2
print(myString[mid-1:mid+2])
?
When converted from base 10, the value is 777 in base 8
What is 511 (base 10) in octal
This one gate is known as a universal gate because one or more of the same gate can be wired up to work like an AND gate, OR gate or a NOT gate.
What is the NAND gate?
The conditional equation in Python represents XOR logic for two expressions A and B.
What is the result of the following equation (or equivalent)?
if (A and not B) or (not A and B):
Outputs:
*
**
***
****
***
**
*
What is the output of:
for i in range(1, 5):
for j in range(i):
print("*", end="")
print()
for i in range(3, 0, -1):
for j in range(i):
print("*", end="")
print()
The code prints all possible pairs of letters of a word. An example would be 'cat' would print:
cc, ca, ct, ac, aa, at, tc, ta, tt
It should work with any "word" that a user enters.
What is the result of the following code?
for x in word:
for y in word:
print(x+y, end=", ")