a = 0
b = 1
c = 2
if a < c:
a = c
if 2 * b == c:
c = 0
elif 2 * b < c:
b = 0
else:
a = 0
if c:
c = 2*(b + a)
elif b:
b = 2*(a + c)
elif a:
a = 2*(b + c)
The value of variable a is , the value of variable b is , and the value of variable c is .
Put the code in the right order to create a program that will ask the user for a number between -20 and 20 (inclusive).Print the number. Then check if the number is positive, negative, or neither. Print the result.
x = int(input("Please enter an integer between -20 and 20: "))
---
print(x)
---
if x > 0:
---
result = "Positive"
---
elif x < 0:
---
result = "Negative"
---
else:
---
result = "Neither"
---
print(result)
Put the code in the right order to create a program that will generate a random number (1 to 100 inclusive), and print the number. Check if the number is a multiple of 2 and print the result. Then check if the number is a multiple of 3 and print the result. Then check if the number is a multiple of 5 and print the result.
x = int(input("Please enter an integer between 1 and 100: "))
---
print(x)
---
if x % 2 == 0:
---
print(x, "is a multiple of 2.")
---
elif x % 2 != 0:
---
print(x, "is not a multiple of 2.")
---
if x % 3 == 0:
---
print(x, "is a multiple of 3.")
---
elif x % 3 != 0:
---
print(x, "is not a multiple of 3.")
---
if x % 5 == 0:
---
print(x, "is a multiple of 5.")
---
elif x % 5 != 0:
---
print(x, "is not a multiple of 5.")