Python Codes (Part 3)
Some Codes for Practicing in Python
1. students=['raju','alim','kayes','asad']
if students == "raju1":
print("Authentication Successful")
else:
print("Cannot Found in the list")
------------------------------------------------------------------------------------------------------------
2. a = 10
if a % 2== 0:
print("a is even number")
else:
print("a is not even number")
--------------------------------------------------------------------------------------------------------------
3. age=22
if age>=18:
print("Eligible ")
else:
print("not eligible")
-------------------------------------------------------------------------------------------------------------------
4. marks=77
if marks >=80:
print("got A+")
elif marks >=75 and marks <=79:
print("got A")
elif marks >=70 and marks <=74:
print("got A-")
elif marks >= 65 and marks<=69:
print("got B+")
elif marks>= 60 and marks<=64:
print("got B")
elif marks >=56 and marks <=59:
print("got B-")
else:
print("not get A+")
---------------------------------------------------------------------------------------------------------------------
5. a=10
b=14
c=15
if a>=b and a>=c:
print("a is greater")
elif b>=a and b>=c:
print("b is greater")
else:
print("c is greater")
------------------------------------------------------------------------------------------------------------------
6. sscgpa = 3.5
hscgpa = 4.0
x = sscgpa * 8
y = hscgpa * 12
if x+y >= 70:
print("Eligible to Apply")
else:
print("Not eligible to Apply")
--------------------------------------------------------------------------------------------------------------
7. choice = 2
if choice == 1:
print("We are in Cox'bazar")
elif choice == 2:
print("We are in Sundarban")
elif choice == 3:
print("We are in Khulna")
else:
print("We are in New-California")
Comments
Post a Comment