Podcast
Questions and Answers
x = 10
y = 20
if x > 5 and y < 25:
x += 5
y += 5
elif x > 5 or y > 25:
x -= 5
y -= 5
else:
x *= 2
y *= 2
x = 10
y = 20
if x > 5 and y < 25:
x += 5
y += 5
elif x > 5 or y > 25:
x -= 5
y -= 5
else:
x *= 2
y *= 2
if data['info']['status'] == 'active' and data['info']['count'] > 30:
result = "Proceed"
else:
result = "Hold"
if data['info']['status'] == 'active' and data['info']['count'] > 30:
result = "Proceed"
else:
result = "Hold"
s = "Hello World"
if s[:5] == "Hello":
print("Greeting detected!")
else:
print("No greeting.")
s = "Hello World"
if s[:5] == "Hello":
print("Greeting detected!")
else:
print("No greeting.")
numbers = [1, 2, 3, 4, 5]
sum = 0
for n in numbers:
if n % 2 == 0:
sum += n
print(sum)
numbers = [1, 2, 3, 4, 5]
sum = 0
for n in numbers:
if n % 2 == 0:
sum += n
print(sum)
Signup and view all the answers