diff --git a/AmritaPandey/conditional_expression.py/Example.py b/AmritaPandey/conditional_expression.py/Example.py new file mode 100644 index 0000000..6508b33 --- /dev/null +++ b/AmritaPandey/conditional_expression.py/Example.py @@ -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") + + + + + + + + + + + + + + + + diff --git a/AmritaPandey/conditional_expression.py/IN and IS.py b/AmritaPandey/conditional_expression.py/IN and IS.py new file mode 100644 index 0000000..e0b2c4b --- /dev/null +++ b/AmritaPandey/conditional_expression.py/IN and IS.py @@ -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") \ No newline at end of file diff --git a/AmritaPandey/conditional_expression.py/Loop_In_Python/while_loops.py b/AmritaPandey/conditional_expression.py/Loop_In_Python/while_loops.py new file mode 100644 index 0000000..e69de29 diff --git a/AmritaPandey/conditional_expression.py/ifelse_and_elif.py b/AmritaPandey/conditional_expression.py/ifelse_and_elif.py new file mode 100644 index 0000000..7201022 --- /dev/null +++ b/AmritaPandey/conditional_expression.py/ifelse_and_elif.py @@ -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") + + + + diff --git a/AmritaPandey/conditional_expression.py/logical operators.py b/AmritaPandey/conditional_expression.py/logical operators.py new file mode 100644 index 0000000..583188b --- /dev/null +++ b/AmritaPandey/conditional_expression.py/logical operators.py @@ -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 + diff --git a/AmritaPandey/conditional_expression.py/multiple if statement.py b/AmritaPandey/conditional_expression.py/multiple if statement.py new file mode 100644 index 0000000..e970cda --- /dev/null +++ b/AmritaPandey/conditional_expression.py/multiple if statement.py @@ -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") \ No newline at end of file diff --git a/AmritaPandey/conditional_expression.py/quiz.py b/AmritaPandey/conditional_expression.py/quiz.py new file mode 100644 index 0000000..7799039 --- /dev/null +++ b/AmritaPandey/conditional_expression.py/quiz.py @@ -0,0 +1,5 @@ +# age=int(input("enter your age:")) +# if(age>18): +# print("you can") +# else: +# print("you can't") \ No newline at end of file diff --git a/AmritaPandey/conditional_expression.py/relational operators.py b/AmritaPandey/conditional_expression.py/relational operators.py new file mode 100644 index 0000000..8dc4fa8 --- /dev/null +++ b/AmritaPandey/conditional_expression.py/relational operators.py @@ -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") \ No newline at end of file