Skip to content

Commit 0c21038

Browse files
committed
incorporate feedback
1 parent ce5649a commit 0c21038

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lessons/python/intro/IntroPython-AH.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@
354354
"outputs": [],
355355
"source": [
356356
"x = 5\n",
357-
"type(x) == int"
357+
"isinstance(x, int)"
358358
]
359359
},
360360
{
@@ -367,7 +367,7 @@
367367
"# if statements allow our scripts to encode more complex instructions\n",
368368
"\n",
369369
"x = 5\n",
370-
"if type(x) == int:\n",
370+
"if isinstance(x, int):\n",
371371
" print(x, 'is an integer')\n"
372372
]
373373
},
@@ -379,7 +379,7 @@
379379
"source": [
380380
"# if-else\n",
381381
"\n",
382-
"if type(x) == str:\n",
382+
"if isinstance(x, str):\n",
383383
" print(x, 'is a string')\n",
384384
"else:\n",
385385
" print(x, 'is not a string')"
@@ -394,9 +394,9 @@
394394
"# if-elif-else\n",
395395
"# useful if we have multiple conditions to test\n",
396396
"\n",
397-
"if type(x) == str:\n",
397+
"if isinstance(x, str):\n",
398398
" print(x, 'is a string')\n",
399-
"elif type(x) == int:\n",
399+
"elif isinstance(x, int):\n",
400400
" print(x, 'is an integer')\n",
401401
"else:\n",
402402
" print(x, 'is neither a string nor an integer')"
@@ -651,7 +651,7 @@
651651
"metadata": {},
652652
"outputs": [],
653653
"source": [
654-
"sns.relplot(x = 'petal_length', y = 'petal_width', data = iris)"
654+
"sns.relplot(x='petal_length', y='petal_width', data=iris)"
655655
]
656656
},
657657
{
@@ -660,7 +660,7 @@
660660
"metadata": {},
661661
"outputs": [],
662662
"source": [
663-
"sns.relplot(x = 'petal_length', y = 'petal_width', hue = 'species', data = iris)"
663+
"sns.relplot(x='petal_length', y='petal_width', hue='species', data=iris)"
664664
]
665665
}
666666
],

0 commit comments

Comments
 (0)