Python With Spyder 2: Basic Arithmetic and Variable Assignment

This is the 2nd in a series of videos providing a tutorial on Python 2.7 using Anaconda Python and the Spyder IDE. Click here to go to a “home page” for the video series.

This video discusses basic arithmetic in Python (basic math operations), variable assignment, transcendental functions (like exp) using the math module, and logicals (including comparison).

The video is about 24 minutes long.

PWS2-DSSThumb

Next Video: Functions and Scoping

Video Index: Basic Arithmetic and Variable Assignment

Click on the topics below to jump to that location in the video.

Time Topic
00:00 Introduction
00:35 Launching the Spyder IDE
01:32 Making the iPython console large
01:49 Showing the Variable Explorer window
02:05 Basic Arithmetic Introduction
02:17 Addition Example
02:22 Multiplication Example
02:27 Order of precidence
02:29 Power (exponentiation) operator
03:17 Caclulating roots using the power operator
03:34 Integer division (unexpected behavior)
04:18 Making floating point numbers using the decimal point
04:47 Types of numbers with “type()”
05:12 Conversion of integers to floting point numbers in mixed expressions
05:43 Advice: Write math expressions in decimals
06:19 Summary of arithmetic in Python
06:40 Assigning variables
06:54 Variables are shown in the Variable Explorer window
07:17 Print the value of a variable
07:34 Print the value of a variable with the “print” statement
07:42 Changing the value of a variable with the Variable Explorer window
08:19 Arithmentic with variables
08:54 Types of variables
09:02 Convert a variable to a floating point number with “float()”
10:07 Transcendental math functions not a part of basic Python
10:41 Importing the “math” module
11:06 Using math functions
11:32 Math constants and the math constant e
11:40 Clear console window with cntr-L
11:49 The math constant pi
11:58 cosine and sine
12:15 Summary of the basic use of trascendental math functions in Python
12:28 “Directory” of the math object using the function “dir()”
13:06 “log()” is the natural logarithm; tesing the log() function to verify what it does.
14:05 Log to the base 10 with “log10()”; testing the log10() function to verify what it does.
14:31 Introduction to logicals
14:40 “True”
14:55 “False”
15:04 Opertations with logicals
15:16 “or”
15:34 “and”
15:47 grouping and “not” (the complement)
16:24 Comparisons: greater than (“>”) and less than (“<")
16:40 Equality (“==”)
17:23 Greater than or equals (“>=”) and less than or equals (“<=")
17:41 Not equals (“!=”)
18:00 Summary of logicals
18:52 Getting information and documentation about Python
19:01 The best way to get information using a search engine such as Google
19:16 Finding Python tutorials
19:24 The python.org web site
19:35 The Python Tutorial at Python.org
19:59 Finding more specific Python information
21:34 The stackoverflow.com web site
22:03 Information about determining the type of an object at stackoverflow.com
22:12 Using “isinstance()”
23:18 Summary of getting information about Python
23:50 Video conclusion

Next Video: Functions and Scoping

4 thoughts on “Python With Spyder 2: Basic Arithmetic and Variable Assignment

    • Thanks for the heads-up on this. YouTube “broke” the syntax of URLs I was using to launch the videos in full screen. All of the videos in the Python With Spyder series are not fixed.

      Thank you very much for notifying me about this problem.

Leave a Comment

Time limit is exhausted. Please reload CAPTCHA.