Ask your own question, for FREE!
Computer Science 16 Online
OpenStudy (anonymous):

Mechanical MOOC OCW 6.189 Python Homework 2 Exercise OPT 2.1 - List Comprehension Challenges - return list of ints The instructions suggested that we use the Python isinstance() function. But when I tried it, bool values, such as True and False got classified as ints along with the actual integers, since bool is a subclass of int. I finally chose to use the type() function instead, so that only ints passed the test. But were we expected to include True and False as ints? Here's the solution that uses the type() function: http://ideone.com/QgWZOy

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!