Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "cells": [
- {
- "cell_type": "code",
- "execution_count": 37,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "inside final else\n",
- "at the end\n",
- "c is 10 and d is 20\n",
- "using or oprerator\n",
- "using not operator\n"
- ]
- }
- ],
- "source": [
- "# Condition Equal\n",
- "\n",
- "a = 5\n",
- "a == 6\n",
- "\n",
- "a!=6\n",
- "\n",
- "'ZA' > 'AB'\n",
- "\n",
- "#Branching\n",
- "\n",
- "age=2\n",
- "\n",
- "\n",
- "\n",
- "if age > 18:\n",
- "\n",
- " print(\"you can enter\" )\n",
- "\n",
- "if age > 10:\n",
- " \n",
- " print(\"age is greater than 10\")\n",
- "\n",
- "elif age > 15:\n",
- " print(\"age is greater than 15\");\n",
- "else:\n",
- " print(\"inside final else\");\n",
- " \n",
- "\n",
- "print(\"at the end\");\n",
- " \n",
- "#Logical Operators\n",
- "\n",
- "c =10;\n",
- "d=20;\n",
- "\n",
- "if (c==10) and (d==20):\n",
- " print(\"c is 10 and d is 20\");\n",
- " \n",
- "elif (c==10) or (d == 10):\n",
- " print(\"Inside else if\");\n",
- " \n",
- "if (c==10) or (d == 10):\n",
- " print ('using or oprerator');\n",
- " \n",
- "if not(c!=10):\n",
- " print(\"using not operator\");\n",
- "\n",
- "\n",
- "\n",
- "\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "Python",
- "language": "python",
- "name": "conda-env-python-py"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.6.7"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 4
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement