{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "c0edccea",
   "metadata": {},
   "source": [
    "Συνάρτηση input()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "abc77dbf",
   "metadata": {},
   "outputs": [],
   "source": [
    "message = \"How many countries exist in the world?\"\n",
    "text = input(message)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7597c877",
   "metadata": {},
   "outputs": [],
   "source": [
    "print(text)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "44b6244b",
   "metadata": {},
   "outputs": [],
   "source": [
    "type(text)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "27aee587",
   "metadata": {},
   "outputs": [],
   "source": [
    "text2 = int(input('How many countries exist in the world?'))\n",
    "print(text2*2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "643709ca",
   "metadata": {},
   "outputs": [],
   "source": [
    "userInput = float(input('Give me a number: '))\n",
    "userInput + 5 "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fcee6952",
   "metadata": {},
   "source": [
    "Συνάρτηση print()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1488f079",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Εκτυπώνεται το περιεχόμενο της παρένθεσης\n",
    "print('Hello, world!')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d2202eea",
   "metadata": {},
   "outputs": [],
   "source": [
    "print(5+5)\n",
    "print(10+10)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8f44331b",
   "metadata": {},
   "source": [
    "Μορφοποίηση εξόδου"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f8294263",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Μήνυμα & εκτύπωση περιεχομένου μεταβλητών\n",
    "in1 = float(input('Give me the fisrt number: '))\n",
    "in2 = float(input('Give me the second number: '))\n",
    "print('Their sum is ', in1+in2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "92aa7973",
   "metadata": {},
   "outputs": [],
   "source": [
    "a = 'Ο Χάρι Πότερ'\n",
    "b = 'και'\n",
    "c = 'η φιλοσοφική λίθος'\n",
    "print(a, b, c)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "df4db17d",
   "metadata": {},
   "outputs": [],
   "source": [
    "print(a + b + c)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7d97ab72",
   "metadata": {},
   "source": [
    "Μορφοποίηση με f' (format)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b2d12885",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Απευθείας ανάθεση\n",
    "artist = 'George Harisson'\n",
    "print(f'{artist} is a great musician!')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3b85334a",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Μορφοποίηση σε σειρά\n",
    "temperature = 350.0 # K\n",
    "pressure = 1 #bar\n",
    "print('Οι συνθήκες του πειράματος είναι θερμοκρασία {} K και πίεση {:.2f} bar'.format(int(temperature), pressure))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ca08992b",
   "metadata": {},
   "source": [
    "'Ελεγχος εκτύπωσης δεκαδικών ψηφίων"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "57004604",
   "metadata": {},
   "outputs": [],
   "source": [
    "ans = 1/3\n",
    "ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7850e241",
   "metadata": {},
   "outputs": [],
   "source": [
    "print(f'{ans:.5f}')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b4aef131",
   "metadata": {},
   "outputs": [],
   "source": [
    "print(f'The value of 1/3 is approximately {ans:.3f}.')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "658470d3",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Δέσμευση 10 θέσεων και εκτύπωση με 3 δεκαδικά\n",
    "print(f'The value of 1/3 is approximately {ans:10.3f}.')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1a28e680",
   "metadata": {},
   "outputs": [],
   "source": [
    "print('The value of 1/3 is', ans, 'approximately')"
   ]
  }
 ],
 "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
}
