0% found this document useful (0 votes)
11 views3 pages

Conditional Statements

Uploaded by

defence576
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)
11 views3 pages

Conditional Statements

Uploaded by

defence576
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
You are on page 1/ 3

IF ELSE CONDITIONAL STATEMENT

x=85
if x >=90 :print( "Excellent performance")
elif x >=80: print(" Very Goodperformance")
elif x >=70 :print("Good performance")
elif x >=60 :print("then average performance")
def num_EV():
num = [7,8, 120, 25, 44, 20, 27]
num = [x for x in num if x%2!=0]
print(num)
num_EV()

l = [5,7,8, 120, 25, 66,45]


l = [x for x in l if x%2==0]
print(l)

l1=[23,45,6,7,8,12,34,234,56]
print(l1[:4])#first four elements
print(l1[-4:])#last four elements

l=list()
for x in range(1,42,2) :
print(x)
l.append(x*2)
print(l)
#To take input from the user,
n = int(input("Enter n: "))
# initialize sum and counter
sum = 0
i=1
while i <= n:
sum += i
i = i+1 # update counter

# print the sum


print("The sum is", sum)

You might also like