Skip to content

Commit 844b8ac

Browse files
committedJun 18, 2019
Posted examples for Lessons 1-13
1 parent 23cf1fd commit 844b8ac

File tree

1,021 files changed

+122455
-0
lines changed

Some content is hidden

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

1,021 files changed

+122455
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"![Self Check Exercises check mark image](files/art/check.png)\n",
8+
"# 2.2 Self Check"
9+
]
10+
},
11+
{
12+
"cell_type": "markdown",
13+
"metadata": {},
14+
"source": [
15+
"**1. _(True/False)_** The following are valid variable names: `3g`, `87` and `score_4`.\n",
16+
"\n",
17+
"**Answer:** False. Because they begin with a digit, 3g and 87 are invalid names.\n",
18+
"\n",
19+
"**2. _(True/False)_** Python treats `y` and `Y` as the same identifier.\n",
20+
"\n",
21+
"**Answer:** False. Python is case sensitive, so `y` and `Y` are different identifiers.\n",
22+
"\n",
23+
"**3. _(IPython Session)_** Calculate the sum of `10.8`, `12.2` and `0.2`, store it in the variable `total`, then display `total`’s value. \n",
24+
"\n",
25+
"**Answer:** "
26+
]
27+
},
28+
{
29+
"cell_type": "code",
30+
"execution_count": null,
31+
"metadata": {},
32+
"outputs": [],
33+
"source": [
34+
"total = 10.7 + 12.2 + 0.2"
35+
]
36+
},
37+
{
38+
"cell_type": "code",
39+
"execution_count": null,
40+
"metadata": {},
41+
"outputs": [],
42+
"source": [
43+
"total"
44+
]
45+
},
46+
{
47+
"cell_type": "code",
48+
"execution_count": null,
49+
"metadata": {},
50+
"outputs": [],
51+
"source": [
52+
"##########################################################################\n",
53+
"# (C) Copyright 2019 by Deitel & Associates, Inc. and #\n",
54+
"# Pearson Education, Inc. All Rights Reserved. #\n",
55+
"# #\n",
56+
"# DISCLAIMER: The authors and publisher of this book have used their #\n",
57+
"# best efforts in preparing the book. These efforts include the #\n",
58+
"# development, research, and testing of the theories and programs #\n",
59+
"# to determine their effectiveness. The authors and publisher make #\n",
60+
"# no warranty of any kind, expressed or implied, with regard to these #\n",
61+
"# programs or to the documentation contained in these books. The authors #\n",
62+
"# and publisher shall not be liable in any event for incidental or #\n",
63+
"# consequential damages in connection with, or arising out of, the #\n",
64+
"# furnishing, performance, or use of these programs. #\n",
65+
"##########################################################################\n"
66+
]
67+
}
68+
],
69+
"metadata": {
70+
"kernelspec": {
71+
"display_name": "Python 3",
72+
"language": "python",
73+
"name": "python3"
74+
},
75+
"language_info": {
76+
"codemirror_mode": {
77+
"name": "ipython",
78+
"version": 3
79+
},
80+
"file_extension": ".py",
81+
"mimetype": "text/x-python",
82+
"name": "python",
83+
"nbconvert_exporter": "python",
84+
"pygments_lexer": "ipython3",
85+
"version": "3.6.6"
86+
}
87+
},
88+
"nbformat": 4,
89+
"nbformat_minor": 2
90+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"45 + 72"
10+
]
11+
},
12+
{
13+
"cell_type": "code",
14+
"execution_count": null,
15+
"metadata": {},
16+
"outputs": [],
17+
"source": [
18+
"5 * (12.7 - 4) / 2"
19+
]
20+
}
21+
],
22+
"metadata": {
23+
"kernelspec": {
24+
"display_name": "Python 3",
25+
"language": "python",
26+
"name": "python3"
27+
},
28+
"language_info": {
29+
"codemirror_mode": {
30+
"name": "ipython",
31+
"version": 3
32+
},
33+
"file_extension": ".py",
34+
"mimetype": "text/x-python",
35+
"name": "python",
36+
"nbconvert_exporter": "python",
37+
"pygments_lexer": "ipython3",
38+
"version": "3.7.1"
39+
}
40+
},
41+
"nbformat": 4,
42+
"nbformat_minor": 2
43+
}

0 commit comments

Comments
 (0)
Please sign in to comment.