''' Purpose: demonstrate program user communication Author: Jim Cohoon Email id: jpc This is a header comment Usually has what the program does and its author ''' # Send message to program user print('Hoos got your back') # If you are encountering issues, please RAISE YOUR HAND AND KEEP IT UP UNTIL A # TA COMES TO SEE YOU. # For Macs and PCs, things are sliiiiightly different because of different # operating systems, but not by much. # How to Get the Right Interpreter Up and Running If Your PyCharm Freaks Out on You About Interpreters! # For Macs: PyCharm Community Edition -> Preferences -> # Project: WhateverYouCalledYourProject -> Project Interpreter -> # PLEASE CHOOSE WHATEVER HAS PYTHON 3.6. DO *NOT* CHOOSE PYTHON 2.7. # It should look like a long series of characters that ends with 3.6. # Clicking "Apply" will show you whether or not you have 3.6.2. # For Windows: File -> Settings -> Project: WhateverYouCalledYourProject -> Project Interpreter -> # PLEASE CHOOSE WHATEVER HAS PYTHON 3.6. DO *NOT* CHOOSE PYTHON 2.7. # It should look like a long series of characters that ends with 3.6. # Clicking "Apply" will show you whether or not you have 3.6.2. # And before you ask: this version of the program with all of these annotations # WILL be posted on the website after class for your viewing and learning pleasure! # Also I am more used to PC than Macs so I apologize in advance for any possible OS screw-ups or bumps I have along the way. # ALSO also feel free to talk to neighbors about things and stuff! # 3 kinds of errors: # syntax: the program did something you didn't want it to because Python could not interpret it (usually a mistyping/misspelling) # semantics: the program did something you didn't want it to because the meaning of a certain piece of code was mis-interpreted # logic: the program did something you didn't want it to usually because some interpretation of a step in the algorithm was misinterpreted # properties of a good algorithm # clear? straightforward? understandable? detailed? language/jargon? - YES! ambiguity is not fun; # someone else needs to be able to understand the steps you delineated...needs to be UNAMBIGUOUS # concise? - if you want, sure! but not necessary # instructive? - YES! listed steps/steps have to be listable (series of distinct, comprehensive/complete FINITE steps) # and each step has to be DOABLE # repeatable? - YES! should give the exact same output every time when given the same exact input...has to be DETERMINISTIC # IN SUMMARY AN ALGORITHM HAS TO BE: # UNDERSTANDABLE/UNAMBIGUOUS, DETERMINISTIC, FINITE # there are more problems than there are algorithms...more on this in later CS courses # you can technically have an algorithm that does nothing; it's useless, but still an algorithm (we love it all the same) :) # you can have an algorithm that takes no input; print_quote.py is an example of such an algorithm # so we talked about algorithms...what are programs? # a program is an algorithm written in a programming language like Python, Java, C++, R, Matlab, C, etc. # questions?? # why are we using Python? - because they told us to, but also because Python is super-popular and a pretty flexible language to start with # Java is the language used in CS2110 and after that, you'll learn C++ and C # I say that once you learn one language, you know them all... # because once you know one, you can figure out a lot of others; # the main difference is just different syntaxes among different languages; # more simply, if you read the same program in Java vs. Python vs. C, they will all # *look* different, but should do the same thing # a statement is a step of an algorithm # this is a comment # you can put comments in programs to specify what certain parts of a program are doing # comments aren't NECESSARY to run a program, but they are SUPER helpful for anyone # reading your code # whitespace is just the spaces between characters; line 72 is just whitespace # most programming languages don't really care about how whitespace is organized, but Python DOES...which we will get to later