CS.Skinny copy.docx - Introduction to Computer Programming Table of Contents 1 Glossary 2 Variables Operands 3 Input Statements Functions 4 Conditionals

CS.Skinny copy.docx - Introduction to Computer Programming...

This preview shows page 1 - 7 out of 62 pages.

Introduction to Computer Programming Table of Contents 1. Glossary 2. Variables, Operands 3. Input Statements, Functions 4. Conditionals 5. Strings 6. Loops aka Iterations 7. Iteration Techniques 8. Keywords 9. Lists 10. Tuples 11. Files 12. Binary and Hexadecimal 13. Clone vs. Alias 14. CSV Files 15. Try/Except and Scope 16. Dictionaries, Enumerate ° 17. API/JSON Requests ° 18. Big O ° 19. Searching Algorithms ° 20. Sorting Algorithms ° 21. Object Oriented Programming ° 22. Modules 23. Recursion ° 24. More Practice
Image of page 1

Subscribe to view the full document.

Glossary 1 ° exception: Another name for a runtime error.
Image of page 2
° runtime error: An error that does not occur until the program has started to execute but that prevents the program from continuing. ° semantic error: An error in a program that makes it do something other than what the programmer intended. ° syntax error: An error in a program that makes it impossible to parse — and therefore impossible to interpret. ° ° Return: provide the output of a function only one return per function If a function does not contain a return statement it automatically returns the value None (of type NoneType) ° ° Data Types Integer (int) o Value with no decimal point o A whole number (negative or positive) o Can be converted (casted) into a float or a string o Examples: -2, 0, 1301 Float (float) o Floating point value o Number that contains a decimal points o Can be converted (casted) into an int (truncated) or a string o Examples: -3.5, 0.0, .23, 5.0, 90.24 Boolean (bool)
Image of page 3

Subscribe to view the full document.

o The values: True, False o Any inequality/equivalency expression o Examples: 2 == 2 True 3 < 2 False True and False True String (str) o Sequence of characters enclosed in quotes (‘a’, “a”, “‘a’”) o Has len() function: len(aString) returns number of chars in the string o Can be concatenated using the + operator “Hello” + “ “ + “world” “Hello world” o Can be duplicated using the * operator “What up, dog?”*2 “What up, dog?What up, dog?” o Examples: len(“the dog”) 7 (white space counts as a character!) NoneType (None) o Default returned when a function doesn’t return anything o None is capitalized! o Ex: >>> a = print(“hello world!”) hello world >>> print(a) None converter functions o int int(3.14) = 3 int(-3.9999) = 3 closer to zero int(“2345”) = 2345 o float float(17) = 17.0 o str str(17) = ‘17’ ° Expression ° Value ° Type
Image of page 4
° 4 + 1.0 ° 5.0 ° float ° 1 % 13 ° 1 ° int ° len(range(10, 5, -2)) ° 3 ° int ° print(“hallo”) ° None ° NoneType ° “Running” / “Run” ° error ° error ° False or True and False ° false ° boolean ° len(“cat”) ** 2 ° 9 ° int ° 10 / 2 ° 5.0 ° float
Image of page 5

Subscribe to view the full document.

immutability : An immutable data type is one that cannot be changed algorithm : the steps that allows the computer to solve a problem argument : input of a function that calls the function block : sections of an algorithm flow of execution : order from top to bottom that Python executes code increment : += local variable : a variable inside of a function Class
Image of page 6
Image of page 7

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes