# The range() function will make a list:
L = range(1, 10)
# Now try this:
L = range(3, 20)
# In general: range(a, b) provides a list
# of values from a to b-1
# Very frequently, we will use the range()
# function to generate a list of index values:
range(0, len(L))
# Slices: Pieces of a list
#
# The range operator is the colon (:)
# It is used to pull out part of a list
# When we extract part of a list, we call
# that a "slice"
s = L[2:7] # Pull out elements 2, 3, 4, 5, 6
# from L and store them in s
# Try this:
L = range(1, 11)
s = L[2:13]
# Didn't get as many values as expected
# In general, use the len() function:
s = L[2:len(L)]
# A slice from a list, is a list
# A slice from a tuple, is a tuple
# Reminder: If you need that slice of tuple
# to be a list, use the list() function on it...
# New Stuff!
#
# Operators: Symbols that do a job
# +, -, *, /, **, % Mathematical Operators
# x = a % b # What is the remainder if a is divided by b?
# x = a ** b # What is a raised to the b power?
# <, >, <=, >=, ==, != Relational Operators
# What is the "domain" of the Math operators?
# "The set of values upon which they work"
# Answer: Numbers
# What is the "range" of the Math operators?
# "The set of possible values resulting"
# Answer: Numbers
# What is the domain of the relational operators?
# Answer: Numbers
# What is the range of the relational operators?
# Answer: Booleans (logicals) - True / False values
# New set of operators: The logical (Boolean) operators
#
# and, or, not
# and: a**False, False->True
#
# One more piece of terminology:
# A "unary" operator is an operator which take only a single input
#
# not is a unary operator (only requires a single "operand")
# - can be a unary operator (e.g. x = -a)
# Binary operators take two inputs
#
# a*b * is binary operator
# a/b / is a binary operator
# is < a binary or unary operator?
# Please read up on Conditionals (IF statements)
# Don't forget to check out the "in" operator
**