Skip to content

Commit 919ac5f

Browse files
authored
Merge pull request #8 from hanamai-org/feature/code
release 4.0 - adding code
2 parents b2d12c1 + 8048345 commit 919ac5f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1428
-416
lines changed

.github/workflows/generate-pdfs-on-release.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,8 @@ jobs:
4242
4343
# Merge all PDFs into one
4444
echo "Merging PDFs..."
45-
pdfunite pdfs/*.pdf corso-python-basic.pdf
46-
find pdfs -type f -name "*.pdf" ! -name "corso-python-basic.pdf" -delete
47-
echo "✅ Conversion complete! Final merged file: corso-python-basic.pdf"
45+
pdfunite pdfs/*.pdf pdfs/corso-python-basic.pdf
46+
echo "Conversion complete! Final merged file: corso-python-basic.pdf"
4847
4948
- name: Upload PDFs to release
5049
env:

00_sommario_corso.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"id": "footer",
6666
"metadata": {},
6767
"source": [
68-
"© 2025 Hanamai. All rights reserved. | Built with precision for real-time data streaming excellence."
68+
"© 2025 hanam.ai - All rights reserved. | Built with precision for real-time data streaming excellence."
6969
]
7070
}
7171
],

01_primi_passi.ipynb

Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -423,17 +423,9 @@
423423
"metadata": {},
424424
"source": [
425425
"### Esercizio 1: Saluto personalizzato\n",
426-
"Modificare il file `greet.py` per chiedere il nome e stampare un messaggio di benvenuto più elaborato."
426+
"Modificare il file `greet.py` trovato nella lezione per chiedere il nome e stampare un messaggio di benvenuto più elaborato."
427427
]
428428
},
429-
{
430-
"cell_type": "code",
431-
"execution_count": null,
432-
"id": "4895b613",
433-
"metadata": {},
434-
"outputs": [],
435-
"source": []
436-
},
437429
{
438430
"cell_type": "markdown",
439431
"id": "92adf2b9",
@@ -443,14 +435,6 @@
443435
"Scrivere un nuovo script chiamato `calculate_square_root.py` che usa la libreria `math` per chiedere un numero all'utente e stampare la sua radice quadrata."
444436
]
445437
},
446-
{
447-
"cell_type": "code",
448-
"execution_count": null,
449-
"id": "35888dbe",
450-
"metadata": {},
451-
"outputs": [],
452-
"source": []
453-
},
454438
{
455439
"cell_type": "markdown",
456440
"id": "5d9176d4",
@@ -461,24 +445,18 @@
461445
]
462446
},
463447
{
464-
"cell_type": "code",
465-
"execution_count": null,
466-
"id": "59ace534",
467-
"metadata": {},
468-
"outputs": [],
469-
"source": []
470-
},
471-
{
472-
"cell_type": "markdown",
473-
"id": "b3f86e9e",
474-
"metadata": {},
475-
"source": [
448+
"cell_type": "markdown",
449+
"id": "72c70c52",
450+
"metadata": {},
451+
"source": [
476452
"---\n",
477-
"## Soluzioni\n",
453+
"## 💡 Soluzioni\n",
454+
"\n",
455+
"> 📂 **[Clicca qui per vedere il codice delle soluzioni](code/01/solutions)**\n",
478456
"\n",
479457
"---"
480-
]
481-
},
458+
]
459+
},
482460
{
483461
"cell_type": "markdown",
484462
"id": "4895b614",
@@ -495,7 +473,7 @@
495473
"outputs": [],
496474
"source": [
497475
"def greet_user():\n",
498-
" user_name = input(\"Wha is your name? \")\n",
476+
" user_name = input(\"What is your name? \")\n",
499477
" print(f\"Hello {user_name}! It is a real pleasure to have you here.\")\n",
500478
"\n",
501479
"if __name__ == \"__main__\":\n",
@@ -557,7 +535,7 @@
557535
"id": "footer",
558536
"metadata": {},
559537
"source": [
560-
"© 2025 Hanamai. All rights reserved. | Built with precision for real-time data streaming excellence."
538+
"© 2025 hanam.ai - All rights reserved. | Built with precision for real-time data streaming excellence."
561539
]
562540
}
563541
],

02_sintassi_base.ipynb

Lines changed: 65 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -540,16 +540,25 @@
540540
"- Continuare a chiedere finché non indovina."
541541
]
542542
},
543+
{
544+
"cell_type": "markdown",
545+
"id": "72c70c51",
546+
"metadata": {},
547+
"source": [
548+
"---\n",
549+
"## 💡 Soluzioni\n",
550+
"\n",
551+
"> 📂 **[Clicca qui per vedere il codice delle soluzioni](code/02/solutions)**\n",
552+
"\n",
553+
"---"
554+
]
555+
},
543556
{
544557
"cell_type": "markdown",
545-
"id": "72c70c51",
558+
"id": "4895b614",
546559
"metadata": {},
547560
"source": [
548-
"---\n",
549-
"## Soluzioni\n",
550-
"\n",
551-
"---\n",
552-
"### Soluzione Esercizio 1: Variabili e tipi\n"
561+
"### Soluzione Esercizio 1: Variabili e tipi"
553562
]
554563
},
555564
{
@@ -559,9 +568,13 @@
559568
"metadata": {},
560569
"outputs": [],
561570
"source": [
562-
"user_name = \"Luca\"\n",
563-
"age = 25\n",
564-
"print(f\"Hi, my name is {user_name} and I am {age} years old.\")"
571+
"def greet_user():\n",
572+
" user_name = \"Luca\"\n",
573+
" age = 25\n",
574+
" print(f\"Hi, my name is {user_name} and I am {age} years old.\")\n",
575+
"\n",
576+
"if __name__ == \"__main__\":\n",
577+
" greet_user()"
565578
]
566579
},
567580
{
@@ -579,14 +592,19 @@
579592
"metadata": {},
580593
"outputs": [],
581594
"source": [
582-
"a = int(input(\"First number: \"))\n",
583-
"b = int(input(\"Second number: \"))\n",
584-
"if a > b:\n",
585-
" print(\"First number is greater.\")\n",
586-
"elif a < b:\n",
587-
" print(\"First number is less.\")\n",
588-
"else:\n",
589-
" print(\"Numbers are equal.\")"
595+
"def guess_numbers():\n",
596+
" a = int(input(\"First number: \"))\n",
597+
" b = int(input(\"Second number: \"))\n",
598+
" if a > b:\n",
599+
" print(\"First number is greater.\")\n",
600+
" elif a < b:\n",
601+
" print(\"First number is less.\")\n",
602+
" else:\n",
603+
" print(\"Numbers are equal.\")\n",
604+
" print(f\"Hi, my name is {user_name} and I am {age} years old.\")\n",
605+
"\n",
606+
"if __name__ == \"__main__\":\n",
607+
" guess_numbers()"
590608
]
591609
},
592610
{
@@ -604,13 +622,17 @@
604622
"metadata": {},
605623
"outputs": [],
606624
"source": [
607-
"grade = int(input(\"Enter a grade: \"))\n",
608-
"if grade >= 60:\n",
609-
" print(\"Passed\")\n",
610-
"elif grade >= 40:\n",
611-
" print(\"Remedial\")\n",
612-
"else:\n",
613-
" print(\"Failed\")"
625+
"def ask_grade():\n",
626+
" grade = int(input(\"Enter a grade: \"))\n",
627+
" if grade >= 60:\n",
628+
" print(\"Passed\")\n",
629+
" elif grade >= 40:\n",
630+
" print(\"Remedial\")\n",
631+
" else:\n",
632+
" print(\"Failed\")\n",
633+
"\n",
634+
"if __name__ == \"__main__\":\n",
635+
" ask_grade()"
614636
]
615637
},
616638
{
@@ -628,8 +650,12 @@
628650
"metadata": {},
629651
"outputs": [],
630652
"source": [
631-
"for i in range(1, 11):\n",
632-
" print(i)"
653+
"def print_numbers():\n",
654+
" for i in range(1, 11):\n",
655+
" print(i)\n",
656+
"\n",
657+
"if __name__ == \"__main__\":\n",
658+
" print_numbers()"
633659
]
634660
},
635661
{
@@ -647,22 +673,26 @@
647673
"metadata": {},
648674
"outputs": [],
649675
"source": [
650-
"secret_number = 7\n",
651-
"while True:\n",
652-
" guess = int(input(\"Guuess a number: \"))\n",
653-
" if guess == secret_number:\n",
654-
" print(\"You guessed it!\")\n",
655-
" break\n",
656-
" else:\n",
657-
" print(\"Try again.\")"
676+
"def guess_number():\n",
677+
" secret_number = 7\n",
678+
" while True:\n",
679+
" guess = int(input(\"Guess a number: \"))\n",
680+
" if guess == secret_number:\n",
681+
" print(\"You guessed it!\")\n",
682+
" break\n",
683+
" else:\n",
684+
" print(\"Try again.\")\n",
685+
"\n",
686+
"if __name__ == \"__main__\":\n",
687+
" guess_number()"
658688
]
659689
},
660690
{
661691
"cell_type": "markdown",
662692
"id": "footer",
663693
"metadata": {},
664694
"source": [
665-
"&copy; 2025 Hanamai. All rights reserved. | Built with precision for real-time data streaming excellence."
695+
"&copy; 2025 hanam.ai - All rights reserved. | Built with precision for real-time data streaming excellence."
666696
]
667697
}
668698
],

0 commit comments

Comments
 (0)