diff --git a/function.py main b/function.py main new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/function.py main @@ -0,0 +1 @@ + diff --git a/if-else.py main b/if-else.py main new file mode 100644 index 000000000000..bee5d1f855b6 --- /dev/null +++ b/if-else.py main @@ -0,0 +1,18 @@ +a=int(input("Enter your age: ")) +print("your age is:", a) +if (a>18): + print("you can drive") + +conditional operators +>, <, >=, <=, ==, != + +print(a>18) +print(a<18) +print(a>=18) +print(a<=18) +print(a==18) +print(a!=18) + + +else: + print("you can not drive") diff --git a/loops.py main b/loops.py main new file mode 100644 index 000000000000..bc5eb4e3cdeb --- /dev/null +++ b/loops.py main @@ -0,0 +1,9 @@ +#for Loop in Python +#Iterating over a string + +name = "Abhishek" +for i in name: + print(i) + + if i=="b": + print("This is special word")