Back
Close

Computing with Data

elgeish
104.5K views

Scalar Data Types

Python's scalar data types and operators are similar to those in C++ and Java. That said, Python's boolean operators are expressed using keywords: and, or, and not:

a = 42
b = float(a)
c = str(a)
d = bool(a)
# print the type and value for each object above
for x in a, b, c, d:
print("type: {}, value: {}".format(type(x), x))
x = True
y = False
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants