Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 115 additions & 0 deletions AmritaPandey/conditional_expression.py/Example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# post=input("enter your post:\n")
# post=post.capitalize()
# if("Himani" in post or "himani" in post):
# print("yes")
# else:
# print("no")


""" OR """
# post=input("enter your post:\n")
# if("himani" in post.lower()):
# print("yes")
# elif("humani" in post.upper()):
# print("yes present")
# else:
# print("not")




""" Eg:2 """
# username=input("Enter your username:\n")
# if(len(username)<10):
# print("yes it is")
# else:
# print("no it isnot")



""" Eg:3 """
# names=["ram", "Shyam","hari","gita"]
# name=input("Enter your Name:")
# if(name in names):
# print("yes presented")
# else:
# print("not presented")



""" Eg:4 """
# marks=int(input("Enter your obtained marks:\n"))
# if marks>=90:
# grade="A+"
# elif marks>=80:
# grade="A"
# elif marks>=70:
# grade="B"
# else:
# grade="F"
# print("your grade is " + grade)



""" Eg:5 """
# N1=int(input("Enter n1:"))
# N2=int(input("Enter n2:"))
# N3=int(input("Enter n3:"))
# N4=int(input("Enter n4:"))
# if(N1>N4):
# g1=N1
# else:
# g1=N4
# if(N2>N3):
# g2=N2
# else:
# g2=N3

# if(g1>g2):
# print(str(g1)+ " is greater")
# else:
# print(str(g2)+ " is greater")


""" Eg:6 """
# sub1=int(input("enter 1st sub marks:\n"))
# sub2=int(input("enter 2nd sub marks:\n"))
# sub3=int(input("enter 3rd sub marks:\n"))
# if(sub1<33 or sub2<33 or sub3<33):
# print("you get less 33% in each sub")
# elif((sub1+sub2+sub3)/3<40):
# print("fail")
# else:
# print("congratulation you are pass")


""" Eg:7 """
# comment=input("enter a comment as your wish:")
# if("make alot of money" in comment):
# spam=True
# elif("buy now" in comment):
# spam=False
# elif("click this" in comment):
# spam=True
# else:
# spam=False
# if(spam):
# print("this is spam")
# else:
# print("it is not")
















14 changes: 14 additions & 0 deletions AmritaPandey/conditional_expression.py/IN and IS.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# marks=30
# if(marks is 30):
# print("yes")
# else:
# print("no")




# a=[1,2,3,4,5,0,7]
# if(2 in a):
# print("present")
# else:
# print("not present")
Empty file.
11 changes: 11 additions & 0 deletions AmritaPandey/conditional_expression.py/ifelse_and_elif.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# age=20
# if (age<10):
# print("age is less then 10")
# elif(age>20):
# print("age is greater then 20 ")
# else:
# print("age is equall to 20")




25 changes: 25 additions & 0 deletions AmritaPandey/conditional_expression.py/logical operators.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# age=45
# if(age>20 and age<50):
# print("you can")
# else:
# print("you can't")




# age=int(input("Enter your age:"))
# if(age>30 or age<60):
# print("you are adult")
# else:
# print("you aren't")




# age=int(input("Enter your age:"))
# if(age!>30 or age<60):
# print("you are adult")
# else:
# print("you aren't")
# pass

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# a=10
# if(a>11):
# print("the value of a is lesser then 11")
# if(a<9):
# print("the value of a is greater then 9")
# else:
# print("the value of a is equal then 10")
5 changes: 5 additions & 0 deletions AmritaPandey/conditional_expression.py/quiz.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# age=int(input("enter your age:"))
# if(age>18):
# print("you can")
# else:
# print("you can't")
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# marks=int(input("enter your marks:"))
# if(marks==80):
# print("you are supeb")
# elif(marks>=60):
# print("you are excellent")
# elif(marks>=40):
# print("you are good")
# elif(marks<=25):
# print("you are fail")