Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions Seth_A99501/day5.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Create the following variables and print them and their types:\n",
"An integer named my_int\n",
"my_int= 23\n",
"A float named my_float\n",
"my_float= 58.6\n",
"A string named my_string\n",
"my_string=\"Independence\"\n",
"A list named my_list\n",
"my_list=[62,23,10,\"test\"]\n",
"A tuple named my_tuple\n",
"my_tuple=(10,6)\n",
"A dictionary named my_dict\n",
"my_dict={'Day':'Friday', 'Energy level': 2.3}\n",
"Check the type of each variable to make sure it matches what you expect.\n",
"print(f'{my_int} is of data type{type(my_int)} ')"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"23 is of data type<class 'int'> \n",
"\n",
"58.6 is of data type<class 'float'>\n",
"\n",
"Independence is of data type<class 'str'>\n",
"\n",
"[62, 23, 10, 'test'] is of data type<class 'list'>\n",
"\n",
"[62, 23, 10, 'test'] is of data type<class 'list'>\n",
"\n",
"(10, 6) is of data type<class 'tuple'>\n",
"\n",
"{'Day': 'Friday', 'Energy level': 2.3} is of data type<class 'dict'>\n"
]
}
],
"source": [
"#declaration of our variables\n",
"my_int= 23\n",
"\n",
"my_float= 58.6\n",
"\n",
"my_string=\"Independence\"\n",
"\n",
"my_list=[62,23,10,\"test\"]\n",
"\n",
"my_tuple=(10,6)\n",
"\n",
"my_dict={'Day':'Friday', 'Energy level': 2.3}\n",
"#print data types of our variables\n",
"print(f'{my_int} is of data type{type(my_int)} \\n')\n",
"print(f'{my_float} is of data type{type(my_float)}\\n')\n",
"print(f'{my_string} is of data type{type(my_string)}\\n')\n",
"print(f'{my_list} is of data type{type(my_list)}\\n')\n",
"print(f'{my_list} is of data type{type(my_list)}\\n')\n",
"print(f'{my_tuple} is of data type{type(my_tuple)}\\n')\n",
"print(f'{my_dict} is of data type{type(my_dict)}')"
]
}
],
"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.11.6"
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}