$ python -c "print('True' if None < 0 else False)"
True
$ python3 -c "print('True' if None < 0 else False)"
Traceback (most recent call last):
File "<string>", line 1, in <module>
TypeError: unorderable types: NoneType() < int()
$ python -c "print('True' if None < 0 else False)"
True
$ python3 -c "print('True' if None < 0 else False)"
Traceback (most recent call last):
File "<string>", line 1, in <module>
TypeError: unorderable types: NoneType() < int()
| { | |
| "cells": [ | |
| { | |
| "cell_type": "code", | |
| "execution_count": 1, | |
| "metadata": { | |
| "collapsed": false | |
| }, | |
| "outputs": [ | |
| { | |
| "ename": "TypeError", | |
| "evalue": "unorderable types: NoneType() > int()", | |
| "output_type": "error", | |
| "traceback": [ | |
| "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", | |
| "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", | |
| "\u001b[1;32m<ipython-input-2-9c797ae3ca97>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;32mNone\u001b[0m \u001b[1;33m>\u001b[0m \u001b[1;36m0\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", | |
| "\u001b[1;31mTypeError\u001b[0m: unorderable types: NoneType() > int()" | |
| ] | |
| } | |
| ], | |
| "source": [ | |
| "None < 0" | |
| ] | |
| } | |
| ], | |
| "metadata": { | |
| "kernelspec": { | |
| "display_name": "Python 3", | |
| "language": "python", | |
| "name": "python3" | |
| }, | |
| "language_info": { | |
| "codemirror_mode": { | |
| "name": "ipython", | |
| "version": 3 | |
| }, | |
| "file_extension": ".py", | |
| "mimetype": "text/x-python", | |
| "name": "python", | |
| "nbconvert_exporter": "python", | |
| "pygments_lexer": "ipython3", | |
| "version": "3.4.1" | |
| } | |
| }, | |
| "nbformat": 4, | |
| "nbformat_minor": 0 | |
| } |