#!/usr/bin/python3 # -*- coding: utf-8 -*- """ This is a multiline comment. @author: taylor@mst.edu Programs are composed of elemental statements """ # Single line comments start with a number/pound symbol. "This is a string-literal" ''' Single quotes are also ok for strings. Multi-line comments are actually just string-literals too, not really comments, like those preceeded by # Top line of this file above is a shebang, which specifies the binary executable to launch this program with; An absolute directory #!/usr/bin/python3 is more secure and explicit, than using an ambiguous lookup like #!/usr/bin/env python3. The 2nd line of this script above specifies encoding, and can occasionally actually be functionaly interpreted by the computer. ''' # %% The # %% defines a "code cell" in spyder. print("In spyder, try hitting ctr-enter to run this cell and stay in it.") print("In spyder, try hitting shift-enter to run this cell and continue.") # %% Indentation matters! # To indent, use 4 spaces, not tabs (\t). # Lines should generally be shorter than about 80 characters, so you can read them on the terminal! Note the linter flag in spyder, telling us not to do this... # This line is OK. x = 1 # The below statement won't run tabbed or spaced over. y = 3 # It produces an error. Learn to read error messages!!!! # IndentationError: unexpected indent # Set up your IDE/linter to catch these and other simple errors.