Skip to content
క
kagitha
/
quiz
/
python-variables-none
Subscribe
Index
⌘K
JAVA NOTEBOOK · QUIZ 29 · BEGINNER
Python variables, None and truthiness
QUESTION 01 / 04
What is Python's equivalent of Java's null?
A
null
B
nil
C
None
D
undefined
SCORE SO FAR · 0 / 0
Share this quiz ↗
What is Python's equivalent of Java's null?
— None. None is Python's "no value". It starts with a capital N, and you check for it with x is None.
You want to check whether name holds the text "Asha". Which is correct Python?
— name == "Asha". In Python == compares values, like Java's equals(). is checks whether two names point to the same object, which is the wrong question for text. Use is only for None.
Which of these values is truthy (counts as true in an if)?
— "False" (the text False). Zero, None, False and empty containers are falsy. "False" is a non-empty string, so it's truthy. Only empty strings are falsy.
What does 7 / 2 give in Python 3?
— 3.5. In Python 3, / always gives a float. Use // for whole-number division, which gives 3.
kagitha
Close
✕
Search everything — articles, videos, chapters, agents, books
01
AI
02
Java
03
System Design
04
Series
05
Manga
06
The Lab
07
Videos
08
Quizzes
09
Books
10
Resume