0% found this document useful (0 votes)
2 views2 pages

Python Logical Questions

The document presents a series of Python logical practice questions that involve conditional statements and control flow. Each question includes a code snippet that tests different logical conditions and outputs specific results based on the values of variables. The examples cover various scenarios such as checking divisibility, evaluating boolean expressions, and determining the largest number among given values.

Uploaded by

hiteshgamingyt
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Python Logical Questions

The document presents a series of Python logical practice questions that involve conditional statements and control flow. Each question includes a code snippet that tests different logical conditions and outputs specific results based on the values of variables. The examples cover various scenarios such as checking divisibility, evaluating boolean expressions, and determining the largest number among given values.

Uploaded by

hiteshgamingyt
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Python Logical Practice Questions

1.
x = 10
if x > 5:
print("A")
print("B")

2.
x = -3
if x:
print("Yes")

3.
n = 15
if n % 5 == 0:
print("Divisible by 5")

4.
x=7
if x % 2 == 0:
print("Even")
else:
print("Odd")

5.
a=0
if a:
print("True")
else:
print("False")

6.
x=5
y = 10
if x > y:
print("X")
else:
print("Y")

7.
marks = 72
if marks >= 90:
print("A")
elif marks >= 75:
print("B")
elif marks >= 60:
print("C")
else:
print("Fail")

8.
x=0
if x > 0:
print("Positive")
elif x < 0:
print("Negative")
else:
print("Zero")

9.
num = 15
if num % 3 == 0 and num % 5 == 0:
print("Both")
elif num % 3 == 0:
print("Three")
elif num % 5 == 0:
print("Five")
else:
print("None")

10.
a = 10
b = 20
c=5
if a > b and a > c:
print("A is largest")
else:
print("A is not largest")

You might also like