{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Lab 1.1 \n",
    "เขียน program บวกเลข ตั้งแต่ 1 .. n ตัวอย่าง\n",
    "n = 10\n",
    "r = 1 + 2 +  ... + n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "enter a: 10\n",
      "enter b: 30\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "'1030'"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a = input('enter a: ')\n",
    "b = input('enter b: ')\n",
    "c = a + b\n",
    "c"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Lab 1.2\n",
    "เขียน program ที่เก็บค่าส่วนต่างๆ ของรถยนต์ คันหนึ่งเช่น width, height, length , color และ เป็นสีแดงให้ print \"I love it\" ถ้าไม่ Goodbye\n",
    "และถ้า width > 200 ให้ print \"very big car\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "...\n",
      "I love it\n"
     ]
    }
   ],
   "source": [
    "car = {'w': 100, 'h':200, 'l':150, 'color': 'red'}\n",
    "for k in car:\n",
    "    if k == 'color':\n",
    "        if car[k] == \"red\":\n",
    "            print(\"I love it\")\n",
    "        else:\n",
    "            print(\"Goodbye\")\n",
    "    if k == \"w\":\n",
    "        if car[k] > 200:\n",
    "            print(\"Very big car\")\n",
    "        else:\n",
    "            print(\"...\")\n",
    "        "
   ]
  }
 ],
 "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.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
