0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
No active XP Potion
Accept a Quest
Login to submit answers
Python has several basic data types.
In programming, snippets of text are called "strings". They're lists of characters strung together. We create strings by wrapping the text in single quotes or double quotes. That said, double quotes are preferred.
name_with_single_quotes = 'boot.dev' # not so good
name_with_double_quotes = "boot.dev" # so good
Numbers are not surrounded by quotes when they're declared.
An integer (or "int") is a number without a decimal part:
x = 5 # positive integer
y = -5 # negative integer
A float is a number with a decimal part:
x = 5.2
y = -5.2
A "Boolean" (or "bool") is a type that can only have one of two values: True
or False
. As you may have heard, computers really only use 1's and 0's. These 1's and 0's are just True/False
boolean values.
is_tall = True
is_short = False
Fix the bugs in the code. player_health
should be an integer and player_has_magic
should be a boolean.
Focus Editor
Alt+Shift+]
Login to Submit
Login to Run
Login to view solution