What does this function print?
def negate(x):
print -x
print negate(5)
Monday, November 28, 2016
Friday, November 25, 2016
Monday, November 21, 2016
Wednesday, November 16, 2016
Monday, November 14, 2016
Blog 25
Look at the code below. What does it print?
x=True
y=False
if x and y:
print "hello"
else:
print "hi"
x=True
y=False
if x and y:
print "hello"
else:
print "hi"
Wednesday, November 9, 2016
Monday, November 7, 2016
Blog 23
Tell me what this program prints.
x = 3
y = 3
while x > 3 or y < 6:
print x
print y
x = 9 - x
y = y + 2
x = 3
y = 3
while x > 3 or y < 6:
print x
print y
x = 9 - x
y = y + 2
Saturday, November 5, 2016
Blog 22
What does this program do?
How many times does the loop go through?
Write all the output lines. (what it prints)
x=10
while x >0:
print x
x = x - 3
How many times does the loop go through?
Write all the output lines. (what it prints)
x=10
while x >0:
print x
x = x - 3
Subscribe to:
Comments (Atom)