1. Section 1 Introduction to Python 1. Python is an efficient language. Reading and Writing operations are very simple, just like normal English. 2. Python is an interpreted language, we don't need to compile it. We just need to write the code to run. 3. Python is an object-oriented language. Everything in Python is an object. 4. Python is an interesting language. 2. Section 1 variable: A variable is a word and has only one single value. 2. Exercise: Set the variable my_variable and set the value to 10 [cpp] # Write your code below! My_variable = 10 3 Section 3 1 Python contains three data types: interage, floats, booleans 2 Python is a case-sensitive language 3 Exercise 1 Set the variable my_int value to 7 2 Set the variable my_float value to 1.23 3 Set the variable my_bool value to true [python] # Set the variables to the values listed in the instructions! My_int = 7 my_float = 1.23 my_bool = True 4 Section 4 1 Python variables can be overwritten at any time 2 exercise: change the value of my_int from 7 to 3, and print out my_int [python] # my_int is set to 7 below. what do you think # will happen if we reset it to 3 and print the result? My_int = 7 # Change the value of my_int to 3 on line 8! My_int = 3 # Here's some code that will print my_int to the console: # The print keyword will be covered in detail soon! Print my_int section 5 1 the declaration of Pyhton is similar to that of English 2 the declaration of using spaces in Python 3 exercises: Check the following code errors [python] def spam (): eggs = 12 return eggs print spam () Section 6 1 spaces in Python indicate correct indentation 2 exercise: Correct Errors in the previous section [python] def spam (): eggs = 12 return eggs print spam () Section 7 1 Python is a language for interpreting execution. As long as you finish writing the code, run 2 exercise: Set the variable spam to True only, the eggs value is False [python] spam = True eggs = False section 8 1 Python annotations are implemented through "#" without affecting code implementation. Exercise 2: add a line of comment to the following code [python] # this is a comm Ents for Python mysterious_variable = 42 section 9 1 multi-line comments of Python are two exercises implemented through: add multiple lines of [python] "" this is a Python course "a = 5 section 10 1 Python has 6 Arithmetic Operators + ,-,*, /, ** (power), % 2 exercise: Set the variable count_to to 1 + 2 [python] # Set count_to equal to 1 plus 2 on line 3! Count_to = 1 + 2 print count_to 11th Section 1 evaluate x ^ m in Python and write it as x ** m 2 exercise: using power calculation, set the eggs value to 100 [python] # Set eggs equal to 100 using exponentiation on line 3! Eggs = 10 ** 2 print eggs section 12th 1 exercise: 1 Write a line of comment 2 set the variable monty to True 3 set the variable python value to 1.234 4 set the value of monty_python to the python square [python] # this is a Python monty = True python = 1.234 monty_python = python ** 2