{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ba8bfde6",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hello world\n"
     ]
    }
   ],
   "source": [
    "# به جهان سلام کنه\n",
    "print('hello world')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f333fde2",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (3880082609.py, line 1)",
     "output_type": "error",
     "traceback": [
      "  \u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[4]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[31m    \u001b[39m\u001b[31mp rint('hello world')\u001b[39m\n      ^\n\u001b[31mSyntaxError\u001b[39m\u001b[31m:\u001b[39m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "# خطا\n",
    "p rint('hello world')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8095c334",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'Print' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[31m---------------------------------------------------------------------------\u001b[39m",
      "\u001b[31mNameError\u001b[39m                                 Traceback (most recent call last)",
      "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[6]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[32m----> \u001b[39m\u001b[32m1\u001b[39m Print(\u001b[33m'hello world'\u001b[39m)\n",
      "\u001b[31mNameError\u001b[39m: name 'Print' is not defined"
     ]
    }
   ],
   "source": [
    "# خطا\n",
    "Print('hello world')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "c4a95b03",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hellofslgnfsljngflknglkf\n"
     ]
    }
   ],
   "source": [
    "print('hellofslgnfsljngflknglkf')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "7fe4ccf8",
   "metadata": {},
   "outputs": [],
   "source": [
    "test=12"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "84d0eae4",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "12\n"
     ]
    }
   ],
   "source": [
    "print(test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "7d13f188",
   "metadata": {},
   "outputs": [],
   "source": [
    "g=12\n",
    "h=18\n",
    "age=8\n",
    "test=9"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "d73a89f8",
   "metadata": {},
   "outputs": [],
   "source": [
    "x=18"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e3bfed4a",
   "metadata": {},
   "source": [
    "اعداد صحیح را ما در متغییر هایی از جنس اینت ذخیره مکنیم"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "3b0c6af4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "int"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x=18\n",
    "#int\n",
    "type(x)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c5a4efe8",
   "metadata": {},
   "source": [
    "اعداد اعشاری را ا در متغییر هایی از جنس فلوت ذخیره میکنیم"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "4340c59b",
   "metadata": {},
   "outputs": [],
   "source": [
    "#float\n",
    "d=13.8"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "e28831b1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "float"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(d)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9cf606a1",
   "metadata": {},
   "source": [
    "کلمات را در متغییر هایی از جنس استرینگ ذخیره میکنیم"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "9558160e",
   "metadata": {},
   "outputs": [],
   "source": [
    "# str\n",
    "h='hello'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "0562e069",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "str"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(h)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d2cb6def",
   "metadata": {},
   "outputs": [],
   "source": [
    "a='hamed'\n",
    "b='khalilavi'\n",
    "c=9\n",
    "v='tegran'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "74cc02af",
   "metadata": {},
   "outputs": [],
   "source": [
    "name='hamed'\n",
    "lname='khalilavi'\n",
    "age=9\n",
    "city='tehran'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "1d633c7b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hamed\n"
     ]
    }
   ],
   "source": [
    "print(name)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "2601548b",
   "metadata": {},
   "outputs": [],
   "source": [
    "s1='hi'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "e7b97488",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "cannot assign to literal here. Maybe you meant '==' instead of '='? (918961475.py, line 1)",
     "output_type": "error",
     "traceback": [
      "  \u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[31]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[31m    \u001b[39m\u001b[31m1='hi'\u001b[39m\n    ^\n\u001b[31mSyntaxError\u001b[39m\u001b[31m:\u001b[39m cannot assign to literal here. Maybe you meant '==' instead of '='?\n"
     ]
    }
   ],
   "source": [
    "1='hi'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "4c4b6d47",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (2945184546.py, line 1)",
     "output_type": "error",
     "traceback": [
      "  \u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[32]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[31m    \u001b[39m\u001b[31ms 1='hi'\u001b[39m\n      ^\n\u001b[31mSyntaxError\u001b[39m\u001b[31m:\u001b[39m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "s 1='hi'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "268cfe98",
   "metadata": {},
   "outputs": [],
   "source": [
    "s_1='hi'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "4c316133",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid decimal literal (1277451914.py, line 1)",
     "output_type": "error",
     "traceback": [
      "  \u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[34]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[31m    \u001b[39m\u001b[31m1x=5\u001b[39m\n    ^\n\u001b[31mSyntaxError\u001b[39m\u001b[31m:\u001b[39m invalid decimal literal\n"
     ]
    }
   ],
   "source": [
    "1x=5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "b7a6ad57",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (1656196763.py, line 1)",
     "output_type": "error",
     "traceback": [
      "  \u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[35]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[31m    \u001b[39m\u001b[31mif='hi'\u001b[39m\n      ^\n\u001b[31mSyntaxError\u001b[39m\u001b[31m:\u001b[39m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "if='hi'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "d2f44f81",
   "metadata": {},
   "outputs": [],
   "source": [
    "x=5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "85957dc0",
   "metadata": {},
   "outputs": [],
   "source": [
    "y=9"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "2b0f6e7c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "45"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x*y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "4d811dd1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "14"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x+y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "5fd80483",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1953125"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x**y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "d17a5395",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.5555555555555556"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x/y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "id": "879d3ff6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "5"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x%y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "id": "2d4b9c79",
   "metadata": {},
   "outputs": [],
   "source": [
    "x=5\n",
    "f='hi'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "179aff68",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "unsupported operand type(s) for +: 'int' and '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[48]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[32m----> \u001b[39m\u001b[32m1\u001b[39m x+f\n",
      "\u001b[31mTypeError\u001b[39m: unsupported operand type(s) for +: 'int' and 'str'"
     ]
    }
   ],
   "source": [
    "x+f"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "id": "f0581d3d",
   "metadata": {},
   "outputs": [],
   "source": [
    "x=29\n",
    "y=1\n",
    "q='29'\n",
    "w='1'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "id": "a6b95ca3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "30"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x+y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "id": "9d6a5498",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'291'"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "q+w"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "id": "93e80038",
   "metadata": {},
   "outputs": [],
   "source": [
    "d='hello'\n",
    "b=30"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "id": "4da4215b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello'"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d*b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "id": "7fdd2a42",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'-'*300"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "id": "6447bf6c",
   "metadata": {},
   "outputs": [],
   "source": [
    "name='Hamed'\n",
    "age=29"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "id": "ad0776be",
   "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[60]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[32m----> \u001b[39m\u001b[32m1\u001b[39m name+age\n",
      "\u001b[31mTypeError\u001b[39m: can only concatenate str (not \"int\") to str"
     ]
    }
   ],
   "source": [
    "name+age"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "id": "eb9f8eb4",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hamed 29\n"
     ]
    }
   ],
   "source": [
    "print(name,age)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "id": "15e8e457",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "my name is: Hamed\n"
     ]
    }
   ],
   "source": [
    "print('my name is:',name)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "id": "c1680ec8",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "my name is: Hamed and my age is: 29\n"
     ]
    }
   ],
   "source": [
    "print('my name is:',name,'and my age is:',age)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "id": "bd60419c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "my name is: Hamed and my age is: 29\n"
     ]
    }
   ],
   "source": [
    "print(f'my name is: {name} and my age is: {age}')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "id": "97e9e0af",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1\n"
     ]
    }
   ],
   "source": [
    "x=5\n",
    "x=8\n",
    "x=12\n",
    "x=1\n",
    "print(x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "id": "3d050e36",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1\n"
     ]
    }
   ],
   "source": [
    "print(x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "id": "429dc31d",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'o' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[31m---------------------------------------------------------------------------\u001b[39m",
      "\u001b[31mNameError\u001b[39m                                 Traceback (most recent call last)",
      "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[73]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[32m----> \u001b[39m\u001b[32m1\u001b[39m print(o)\n\u001b[32m      2\u001b[39m o=\u001b[32m18\u001b[39m\n",
      "\u001b[31mNameError\u001b[39m: name 'o' is not defined"
     ]
    }
   ],
   "source": [
    "print(o)\n",
    "o=18"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "adf1dd32",
   "metadata": {},
   "outputs": [],
   "source": [
    "name = 'حامد'"
   ]
  }
 ],
 "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.12.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
