Initial commit · fluentpython/example-code-2e@4125db1

Original file line numberDiff line numberDiff line change

@@ -28,7 +28,7 @@

2828

},

2929

{

3030

"cell_type": "code",

31-

"execution_count": 1,

31+

"execution_count": 4,

3232

"metadata": {},

3333

"outputs": [],

3434

"source": [

@@ -52,7 +52,7 @@

5252

},

5353

{

5454

"cell_type": "code",

55-

"execution_count": 2,

55+

"execution_count": 5,

5656

"metadata": {},

5757

"outputs": [

5858

{

@@ -61,7 +61,7 @@

6161

"Card(rank='7', suit='diamonds')"

6262

]

6363

},

64-

"execution_count": 2,

64+

"execution_count": 5,

6565

"metadata": {},

6666

"output_type": "execute_result"

6767

}

@@ -73,7 +73,7 @@

7373

},

7474

{

7575

"cell_type": "code",

76-

"execution_count": 3,

76+

"execution_count": 6,

7777

"metadata": {},

7878

"outputs": [

7979

{

@@ -82,7 +82,7 @@

8282

"52"

8383

]

8484

},

85-

"execution_count": 3,

85+

"execution_count": 6,

8686

"metadata": {},

8787

"output_type": "execute_result"

8888

}

@@ -94,7 +94,7 @@

9494

},

9595

{

9696

"cell_type": "code",

97-

"execution_count": 4,

97+

"execution_count": 7,

9898

"metadata": {},

9999

"outputs": [

100100

{

@@ -103,7 +103,7 @@

103103

"Card(rank='2', suit='spades')"

104104

]

105105

},

106-

"execution_count": 4,

106+

"execution_count": 7,

107107

"metadata": {},

108108

"output_type": "execute_result"

109109

}

@@ -114,7 +114,7 @@

114114

},

115115

{

116116

"cell_type": "code",

117-

"execution_count": 5,

117+

"execution_count": 8,

118118

"metadata": {},

119119

"outputs": [

120120

{

@@ -123,7 +123,7 @@

123123

"Card(rank='A', suit='hearts')"

124124

]

125125

},

126-

"execution_count": 5,

126+

"execution_count": 8,

127127

"metadata": {},

128128

"output_type": "execute_result"

129129

}

@@ -134,16 +134,16 @@

134134

},

135135

{

136136

"cell_type": "code",

137-

"execution_count": 6,

137+

"execution_count": 9,

138138

"metadata": {},

139139

"outputs": [

140140

{

141141

"data": {

142142

"text/plain": [

143-

"Card(rank='6', suit='diamonds')"

143+

"Card(rank='2', suit='diamonds')"

144144

]

145145

},

146-

"execution_count": 6,

146+

"execution_count": 9,

147147

"metadata": {},

148148

"output_type": "execute_result"

149149

}

@@ -157,7 +157,7 @@

157157

},

158158

{

159159

"cell_type": "code",

160-

"execution_count": 7,

160+

"execution_count": 10,

161161

"metadata": {},

162162

"outputs": [

163163

{

@@ -168,7 +168,7 @@

168168

" Card(rank='4', suit='spades')]"

169169

]

170170

},

171-

"execution_count": 7,

171+

"execution_count": 10,

172172

"metadata": {},

173173

"output_type": "execute_result"

174174

}

@@ -179,7 +179,7 @@

179179

},

180180

{

181181

"cell_type": "code",

182-

"execution_count": 8,

182+

"execution_count": 11,

183183

"metadata": {},

184184

"outputs": [

185185

{

@@ -191,7 +191,7 @@

191191

" Card(rank='A', suit='hearts')]"

192192

]

193193

},

194-

"execution_count": 8,

194+

"execution_count": 11,

195195

"metadata": {},

196196

"output_type": "execute_result"

197197

}

@@ -202,7 +202,7 @@

202202

},

203203

{

204204

"cell_type": "code",

205-

"execution_count": 9,

205+

"execution_count": 12,

206206

"metadata": {},

207207

"outputs": [

208208

{

@@ -271,7 +271,7 @@

271271

},

272272

{

273273

"cell_type": "code",

274-

"execution_count": 10,

274+

"execution_count": 13,

275275

"metadata": {},

276276

"outputs": [

277277

{

@@ -340,7 +340,7 @@

340340

},

341341

{

342342

"cell_type": "code",

343-

"execution_count": 11,

343+

"execution_count": 14,

344344

"metadata": {},

345345

"outputs": [

346346

{

@@ -349,7 +349,7 @@

349349

"True"

350350

]

351351

},

352-

"execution_count": 11,

352+

"execution_count": 14,

353353

"metadata": {},

354354

"output_type": "execute_result"

355355

}

@@ -360,7 +360,7 @@

360360

},

361361

{

362362

"cell_type": "code",

363-

"execution_count": 12,

363+

"execution_count": 15,

364364

"metadata": {},

365365

"outputs": [

366366

{

@@ -369,7 +369,7 @@

369369

"False"

370370

]

371371

},

372-

"execution_count": 12,

372+

"execution_count": 15,

373373

"metadata": {},

374374

"output_type": "execute_result"

375375

}

@@ -380,7 +380,7 @@

380380

},

381381

{

382382

"cell_type": "code",

383-

"execution_count": 13,

383+

"execution_count": 16,

384384

"metadata": {},

385385

"outputs": [

386386

{

@@ -453,6 +453,26 @@

453453

" print(card)"

454454

]

455455

},

456+

{

457+

"cell_type": "code",

458+

"execution_count": 17,

459+

"metadata": {},

460+

"outputs": [

461+

{

462+

"data": {

463+

"text/plain": [

464+

"{'spades': 3, 'hearts': 2, 'diamonds': 1, 'clubs': 0}"

465+

]

466+

},

467+

"execution_count": 17,

468+

"metadata": {},

469+

"output_type": "execute_result"

470+

}

471+

],

472+

"source": [

473+

"suit_values"

474+

]

475+

},

456476

{

457477

"cell_type": "markdown",

458478

"metadata": {},

@@ -599,7 +619,7 @@

599619

"name": "python",

600620

"nbconvert_exporter": "python",

601621

"pygments_lexer": "ipython3",

602-

"version": "3.8.0"

622+

"version": "3.12.3"

603623

}

604624

},

605625

"nbformat": 4,