16 is an integer
False is a boolean
Beijan is a string
26
['Nikki', 'Monika', 'Ankit', 'Varun']
True
Tesla
# Integer: a numerical value as a variable
age = 16
print("You are "+ str(age) +" years old.")
# List: a set of value in one variable
schedule = ["Engineering", "Physics 1", "Calculus", "Computer Science"]
print(schedule[1])
# Boolean: a variable that represents a true or a False
raining = False
print("An example of a boolean is, "+ str(raining))
# String: a collection of characters in a variable
name = "Beijan"
print("Hello my name is "+ name)
# List with JSON
import json
ages = [15,16,17,18]
#print shows what kind of variable ages is
print(type(ages))
#json.dumps turn integers into strings in lists to be able to print them out
ages = json.dumps(ages)
print(ages)
print(type(ages))
You are 16 years old.
Physics 1
An example of a boolean is, False
Hello my name is Beijan
<class 'list'>
[15, 16, 17, 18]
<class 'str'>