\n",
"
Imparare Facendo
\n",
" Create un file
test.py nella cartella
ShellPrograms usando un editor di programmazione (Per esempio Notepad su Windows o TextEdit su Mac). In
test.py inserite i comandi per:\n",
"
\n",
"- assegnare il valore 17 alla variabile a;\n",
"
- assegnare alla variabile b il quadrato di a;\n",
"
- stampare il valore di b. \n",
"
\n",
"Salvate e chiudete il file. Aprite una finestra di comando ed eseguite il file con il comando
python test.py.\n",
"
\n",
"Eseguite il comando
python per lanciare lo shell di python. Eseguite lo script con il comando
import test.py\n",
"
\n",
" Uscite dallo shell di python con il comando
quit().\n",
"
"
]
}
],
"metadata": {
"hide_input": false,
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.9.12"
},
"toc": {
"base_numbering": 1,
"nav_menu": {},
"number_sections": true,
"sideBar": true,
"skip_h1_title": true,
"title_cell": "Table of Contents",
"title_sidebar": "Contents",
"toc_cell": false,
"toc_position": {},
"toc_section_display": true,
"toc_window_display": false
},
"varInspector": {
"cols": {
"lenName": 16,
"lenType": 16,
"lenVar": 40
},
"kernels_config": {
"python": {
"delete_cmd_postfix": "",
"delete_cmd_prefix": "del ",
"library": "var_list.py",
"varRefreshCmd": "print(var_dic_list())"
},
"r": {
"delete_cmd_postfix": ") ",
"delete_cmd_prefix": "rm(",
"library": "var_list.r",
"varRefreshCmd": "cat(var_dic_list()) "
}
},
"types_to_exclude": [
"module",
"function",
"builtin_function_or_method",
"instance",
"_Feature"
],
"window_display": false
}
},
"nbformat": 4,
"nbformat_minor": 4
}