{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "9d2085e3",
   "metadata": {},
   "source": [
    "Αριθμητικές πράξεις"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c93d479c",
   "metadata": {},
   "outputs": [],
   "source": [
    "i = 5\n",
    "j = 10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d9bac223",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Αποτέλεσμα: int μόνο αν και τα δύο είναι int, διαφορετικά float\n",
    "i+j"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f28d29fe",
   "metadata": {},
   "outputs": [],
   "source": [
    "i + 10.0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "758cc3b9",
   "metadata": {},
   "outputs": [],
   "source": [
    "i-j"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "99675803",
   "metadata": {},
   "outputs": [],
   "source": [
    "i*j"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ee163f0c",
   "metadata": {},
   "outputs": [],
   "source": [
    "i/j # Πάντα float"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1884bf1c",
   "metadata": {},
   "outputs": [],
   "source": [
    "i // j "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "36d12f42",
   "metadata": {},
   "outputs": [],
   "source": [
    "i%j"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "747544c3",
   "metadata": {},
   "outputs": [],
   "source": [
    "i**j"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f096db5d",
   "metadata": {},
   "source": [
    "Η βιβλιοθήκη math"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c123bae3",
   "metadata": {},
   "outputs": [],
   "source": [
    "import math # πρέπει να εκτελεστεί πριν την κλήση των συναρτήσεων!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a0121a40",
   "metadata": {},
   "outputs": [],
   "source": [
    "math.pi"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "76c4f999",
   "metadata": {},
   "outputs": [],
   "source": [
    "math.sqrt(6)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "40b9b27d",
   "metadata": {},
   "outputs": [],
   "source": [
    "math.cos(math.pi*2)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "57126213",
   "metadata": {},
   "source": [
    "Επιπλέον ενσωματωμένες συναρτήσεις\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "831e8d4f",
   "metadata": {},
   "outputs": [],
   "source": [
    "help(5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0c3a4ede",
   "metadata": {},
   "outputs": [],
   "source": [
    "dir(5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a461f514",
   "metadata": {},
   "outputs": [],
   "source": [
    "abs(-5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0d4514e1",
   "metadata": {},
   "outputs": [],
   "source": [
    "max(5,8,3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "941e9718",
   "metadata": {},
   "outputs": [],
   "source": [
    "min(5,8,3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a37310f7",
   "metadata": {},
   "outputs": [],
   "source": [
    "pow(5,2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "115f6d20",
   "metadata": {},
   "outputs": [],
   "source": [
    "round(4.8)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "545893b1",
   "metadata": {},
   "outputs": [],
   "source": [
    "round(4.2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "afa15e82",
   "metadata": {},
   "outputs": [],
   "source": [
    "divmod(4,2)"
   ]
  }
 ],
 "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.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
