{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "383544ab",
   "metadata": {},
   "source": [
    "شرط ها در برنامه نویسی\n",
    "\n",
    "if\n",
    "\n",
    "elif\n",
    "\n",
    "else"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "True\n"
     ]
    }
   ],
   "source": [
    "print(10>8)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "068d64bb",
   "metadata": {},
   "source": [
    "بله/آره /yes / 1 / انجام بده/ درسته \n",
    "\n",
    "True"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "64f1992c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "False\n"
     ]
    }
   ],
   "source": [
    "print(10<8)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ede37e63",
   "metadata": {},
   "source": [
    "نخیر / نه / انجام نده / 0 / no / "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d3dd2c50",
   "metadata": {},
   "outputs": [],
   "source": [
    "# <\n",
    "\n",
    "# >\n",
    "\n",
    "# >=\n",
    "\n",
    "# <=\n",
    "\n",
    "# ==\n",
    "\n",
    "# !="
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "456bbf90",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "True\n"
     ]
    }
   ],
   "source": [
    "print(10>=10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "c66b6b61",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "False\n"
     ]
    }
   ],
   "source": [
    "print(15<=10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "9ee4d2ce",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "cannot assign to literal here. Maybe you meant '==' instead of '='? (2975699964.py, line 1)",
     "output_type": "error",
     "traceback": [
      "  \u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[9]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[31m    \u001b[39m\u001b[31m10=10\u001b[39m\n    ^\n\u001b[31mSyntaxError\u001b[39m\u001b[31m:\u001b[39m cannot assign to literal here. Maybe you meant '==' instead of '='?\n"
     ]
    }
   ],
   "source": [
    "10=10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "50ebdaeb",
   "metadata": {},
   "outputs": [],
   "source": [
    "a=10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "1ca4d950",
   "metadata": {},
   "outputs": [],
   "source": [
    "d=15"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "8b4d13f5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "10==10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "6f0a967f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "10==8"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "e9a97bc2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'hello' == 'hello'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "caaeafed",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'hi' == 'hi '"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "7bad0570",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'hi' == 'hello'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "c28d43c9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "18 != 5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "5abe45e2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "12 != 12"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "39e79298",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hi\n"
     ]
    }
   ],
   "source": [
    "if 10>8:\n",
    "    print('hi')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "36ece9a9",
   "metadata": {},
   "outputs": [],
   "source": [
    "if 18<5:\n",
    "    print('hi')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "fbf93e4f",
   "metadata": {},
   "outputs": [],
   "source": [
    "if 10>12:\n",
    "    slfgnldfng"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "23a7ae4b",
   "metadata": {},
   "outputs": [],
   "source": [
    "ali = 'سلام خوبی؟'\n",
    "\n",
    "if ali=='سلام':\n",
    "    print('سلام علی')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "045f79f8",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "سلام علی\n",
      "من خوبم تو چطوری\n"
     ]
    }
   ],
   "source": [
    "ali = 'سلام خوبی چخبر چه میکنی؟ ....'\n",
    "\n",
    "if 'سلام' in ali:\n",
    "    print('سلام علی')\n",
    "    if 'خوبی' in ali:\n",
    "        print('من خوبم تو چطوری')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "id": "2d49c0e6",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "هوا سرده کولر خاموش شد🥶\n",
      "هوا خیلی سرده بخاری روشن شد 🤧\n"
     ]
    }
   ],
   "source": [
    "temp = 4\n",
    "\n",
    "if temp > 30 :\n",
    "    print('هوا گرمه کولر روشن شد.🥵')\n",
    "if temp < 20 : \n",
    "    print('هوا سرده کولر خاموش شد🥶')\n",
    "if temp < 8 :\n",
    "    print('هوا خیلی سرده بخاری روشن شد 🤧')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "1981f664",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hot\n"
     ]
    }
   ],
   "source": [
    "temp = 32\n",
    "\n",
    "if temp>30:\n",
    "    print('hot')\n",
    "else :\n",
    "    print('cold')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "id": "b11592a2",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "هوا سرده کولر خاموش شد🥶\n"
     ]
    }
   ],
   "source": [
    "temp = 18\n",
    "\n",
    "if temp > 30 :\n",
    "    print('هوا گرمه کولر روشن شد.🥵')\n",
    "elif temp < 8 :\n",
    "    print('هوا خیلی سرده بخاری روشن شد 🤧')\n",
    "elif temp < 20 : \n",
    "    print('هوا سرده کولر خاموش شد🥶')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8db9fb80",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "داری اشتباه وارد میکتی تهش صفره تو چکار کردی مگه؟🥶\n"
     ]
    }
   ],
   "source": [
    "score = -1\n",
    "\n",
    "\n",
    "if score > 20:\n",
    "    print('نمره وارد شده بزرگ از 20 است')\n",
    "\n",
    "elif score >=17 :\n",
    "    print('عالی بودی🥳')\n",
    "elif score >= 14:\n",
    "    print('کارت خوب بود 😃')\n",
    "elif score >= 10:\n",
    "    print('نیاز به تلاش بشتر دار ولی شانس اوردی😒')\n",
    "elif score < 0 :\n",
    "    print('داری اشتباه وارد میکتی تهش صفره تو چکار کردی مگه؟🥶')\n",
    "elif score < 10:\n",
    "    print('داداش سال دیگه میبینمت😶‍🌫️🙄')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "id": "f31b411f",
   "metadata": {},
   "outputs": [],
   "source": [
    "test = input('نام خود را وارد کنید')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "id": "2e35969a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "حامد\n"
     ]
    }
   ],
   "source": [
    "print(test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "beaac4c6",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "can only concatenate str (not \"int\") to str",
     "output_type": "error",
     "traceback": [
      "\u001b[31m---------------------------------------------------------------------------\u001b[39m",
      "\u001b[31mTypeError\u001b[39m                                 Traceback (most recent call last)",
      "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[82]\u001b[39m\u001b[32m, line 2\u001b[39m\n\u001b[32m      1\u001b[39m a=input()\n\u001b[32m----> \u001b[39m\u001b[32m2\u001b[39m a+\u001b[32m5\u001b[39m\n",
      "\u001b[31mTypeError\u001b[39m: can only concatenate str (not \"int\") to str"
     ]
    }
   ],
   "source": [
    "a=input()\n",
    "\n",
    "a+5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "id": "73a06864",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'str'>\n",
      "<class 'int'>\n"
     ]
    }
   ],
   "source": [
    "a=input()\n",
    "\n",
    "print(type(a))\n",
    "\n",
    "b=int(a)\n",
    "\n",
    "print(type(b))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "id": "65952704",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "13\n"
     ]
    }
   ],
   "source": [
    "test = input('دمای هوارا وارد کنید')\n",
    "test2 = int(test)\n",
    "print(test2+1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2b67f030",
   "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": "undefined.undefined.undefined"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
