Binary
Name 2 types of Memory in Computers
RAM, HardDrive, Disk Drive
OR
Primary Memory, Secondary Memory
OR
Volatile and Non-Volatile Memory
print(Hello World)
print("Hello World")
Python uses what feature to indicate a block of code? eg, inside an if statement?
indentation
n = 5
x = n + 20
print(x+5)
for i in range (1, 3):
print ("Hello")
Hello
Hello
What is the decimal value of 1111 1111
255
my name = "Sujatha"
myname = "Sujatha"
#What does this code do logically? Assume user inputs n
if n%2 = 0:
print("???")
else:
print("***")
find if a number n is even or odd
print("Hello/tare your there?")
Hello/tare your there?
for i in range (2):
print("what?")
what
what
A ................. translates source code / high level language into binary /machine code
Compiler / Interpreter
print("Hello" + \n + "World")
print("Hello\nWorld")
OR
print("Hello" + "\n" + World")
what's the output?
count = 1
while count < 10:
if count == 2:
print("2")
count += 2
print("10" + "2")
102
count = 0
while count !=3:
print ("word")
count++
word
word
word
How many bits in 3 bytes?
24
The command to input a number from the user:
n = input(int("Enter a number: "))
n = int(input("Enter a number"))
x = 5
for i in range (4)
x++
print (x)
9
x = "My"
y = "Friends"
print(x+"y", end = ",")
print(y)
Myy, Friends
for i in range (1, 100, 10):
print(i, end = " ")
1 11 21 31 41 51 61 71 81 91
How many candles do I need to represent 6 (decimal) in binary
3
6(dec) is 110(bin)
n = 5
print("Nubmer is" + n)
n = 5
print(Nubmer is" + str(n))
x = "test"
n = 8
if x == "test":
n = 5
elif n == 8:
n = 10
print(n)
5
n = "25"
print(n*2)
2525
n = 0
while n < 6:
n=n+1
print(n)
1
2
3
4
5
6