Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "cells": [
- {
- "cell_type": "code",
- "execution_count": 1,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "False"
- ]
- },
- "execution_count": 1,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "a=5\n",
- "a==6"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 3,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "True"
- ]
- },
- "execution_count": 3,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "a==5"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 4,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "True"
- ]
- },
- "execution_count": 4,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "a>=5"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 5,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "False"
- ]
- },
- "execution_count": 5,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "a!=5"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 1,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "False"
- ]
- },
- "execution_count": 1,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "'abcde'=='faghc'"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 4,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "False"
- ]
- },
- "execution_count": 4,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "'mark'=='mike'"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 6,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "True"
- ]
- },
- "execution_count": 6,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "'mark'!='mike'"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 11,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "you can enter\n",
- "move on\n"
- ]
- }
- ],
- "source": [
- "age=19\n",
- "if age >18:\n",
- " print('you can enter')\n",
- "print('move on')\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 13,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "you can enter\n",
- "move on\n"
- ]
- }
- ],
- "source": [
- "age=19\n",
- "if age > 18:\n",
- " print('you can enter')\n",
- "else:\n",
- " print('go to meatloaf')\n",
- "print('move on')"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 17,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "go to pinkloyd\n",
- "move on\n"
- ]
- }
- ],
- "source": [
- "age=15\n",
- "if age>18:\n",
- " print('you can enter')\n",
- "elif age==18:\n",
- " print('go to meatloaf')\n",
- "else:\n",
- " print('go to pinkloyd')\n",
- "print('move on')"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 20,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "ghost student\n",
- "do something\n"
- ]
- }
- ],
- "source": [
- "graduation_year = 1980\n",
- "graduation_year = 1960\n",
- "if graduation_year>1980:\n",
- " print('graduation later than 1980')\n",
- "elif graduation_year<1973:\n",
- " print('ghost student')\n",
- "else:\n",
- " print('investigate')\n",
- "print('do something')"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 23,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "valid grad year\n",
- "\n",
- "our student\n"
- ]
- }
- ],
- "source": [
- "grad_year=1980\n",
- "if (grad_year>1979) and (grad_year<1990):\n",
- " print('valid grad year')\n",
- "print(\"\")\n",
- "print('our student')\n",
- " "
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 26,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "investigate\n",
- "all results subject to verification\n"
- ]
- }
- ],
- "source": [
- "grad_year=1993\n",
- "if (grad_year>1979) and (grad_year<1990):\n",
- " print('valid grad year')\n",
- "elif (grad_year<=1978) and (grad_year>=1991):\n",
- " print('not our student')\n",
- "else:\n",
- " print('investigate')\n",
- "print('all results subject to verification')"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "Python 3",
- "language": "python",
- "name": "python3"
- },
- "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