thewhitetulip / build-app-with-python-antitextbook

Aims to teach Python3 by example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chapter 03-01, isinstance for type comparison

gdassori opened this issue · comments

commented

In chapter 03-01 you did type comparison with the expression:

if type(a) == type(""): print("a is string")

You may want to say that everything in Python is an object, and explains why and how

isinstance('a string', str)

works as well.