# It can print strings
print("Hello World") #prints Hello NOOBS
# It can print Numbers
print(-13) #prints the Number: 66
# It can print complex Objects
x = ["Ohio", "Georgia", "New York"]
print(x) #prints ["Ohio", "Georgia", "New York"]
print(x[1]) #prints just Georgia
print(len("Your Name Here"))
# Try messing around with the below print statement
print()
Hello World
-13
['Ohio', 'Georgia', 'New York']
Georgia
14
# print("SEE")
# Single line comments start with an #
# Multi Line comments start and end with 3 " like """This"""
x = 10
print(x) # prints 10
10
x = "Python Rocks"
print(x) # print String
Python Rocks
y="Donuts are the BEST!"
print(y)
Donuts are the BEST!
x = 10
print("var x is: ",type(x))
var x is: <class 'int'>
y = 3.5
print("var y is: ",type(y))
var y is: <class 'float'>
a = '25'
b = 'PYTHON IS A SNAKE!'
print("var a is: ",type(a))
print("var b is: ",type(b))
var a is: <class 'str'>
var b is: <class 'str'>
c = True
d = False
print("var c is: ",type(c))
print("var d is: ",type(d))
var c is: <class 'bool'>
var d is: <class 'bool'>
f = ["Ohio", "Georgia", "New York"]
print("var f is: ", type(f))
g = {0: "Hi", 1: "Bye"}
print("var g is: ", type(g))
h = ("Alex", 24, "Quote: I feel old!", 2020)
print("var h is: ", type(h))
# As you can see there are more variable types but these all fall under the class of object variables.
var f is: <class 'list'>
var g is: <class 'dict'>
var h is: <class 'tuple'>
print(10 + 5) # prints 15
print(10 - 5) # prints 5
print(10 * 5) # prints 50
print(10 / 5) # prints 2.0
15
5
50
2.0
x = 10
y = 5
print(x + y) # prints 15
print(x - y) # prints 5
print(x * y) # prints 50
print(x / y) # prints 2.0
15
5
50
2.0
a = "Hello "
b = "World!"
print(a+b)
print(a * 10)
Hello World!
Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello
print(7 % 5) # prints 2 because 7/5 has a remainder of 2
print(4 ** 3) # prints 64 because 4*4*4 = 4^3 = 64
2
64
myInput = input("What is your name: ")
# Type Alex into the text box
print("Hello", myInput)
Hello Alex
myInput = int(input("Enter a Whole Number: "))
# Type 10 into the text box
print(myInput * 2)
20
myInput = float(input("Enter a Whole Number: "))
# Type 10.1 into the text box
print(myInput * 2)
20.2
myInput = int(input("Enter a Whole Number: "))
# Type "Ten" into the text box
print(myInput * 2)
ValueError: invalid literal for int() with base 10: 'Ten'