Presentation is loading. Please wait.

Presentation is loading. Please wait.

EECS 183 Discussion #9: It’s time to “Git” Python! November 22nd, 2016

Similar presentations


Presentation on theme: "EECS 183 Discussion #9: It’s time to “Git” Python! November 22nd, 2016"— Presentation transcript:

1 EECS 183 Discussion #9: It’s time to “Git” Python! November 22nd, 2016
Kevin Lee (mrkevin)

2 Final Projects Tip #1: Start early!!! Tip #2: Not lying.
Remember, this is a group project! You need to meet up with your team members. Tip #3: Work as a team together, not as many individuals Try not to split up work individually, but rather tackle these problems together! Counter-argument: Reaches Tip #4: If you need motivation, remember that companies will be at the final showcase! Last year we had companies such as JP Morgan Chase walking around seeing projects!

3 Github What is it, and how do we use it?

4 Github What is Github?  VERSION CONTROL Collaboration Online backup
Github is version control, meaning the opportunity to go back to any old code you ever wrote. Collaboration Online backup Timeline of Project Progress Accountability You can see who has written what in your project’s code

5 Git Terminal How does one navigate the dark, scary terminal?
ls : List files / folders in your directory pwd : Print Working Directory cd [path] : Change Directory to a specified path / place q : Quit mkdir [path] : Make directory Note: The most important ones are ls and cd!

6 Github Flow

7 Github Flow git clone: One-time command to synchronize repository to your local computer. git status: Shows what files have changed since last push. git pull: Grab files from repository, similar to git clone but more common. Edit files: Yep. git add: Add changed files to prepare it for pushing. git commit: Write a message associated with files, final preparation for pushing. git push: Push files to repository. Note: The most common lines you will be writing are: “git add, git commit, git push”.

8 Python Hiss hiss…!

9 Python vs. C++ Differences between C++ and Python:
True and False are capitals Python floors with int division C++: -3 / 2 = -1 Python: -3 / 2 = -2 No variable declarations (!!!) Automatically interprets based on what you assign it to! my_string = “Hello” my_int = 5 Python has no ++ operator Arrays vs. List Next slide!

10 Arrays vs. Lists C++ vs. Python C++ PYTHON
C++ has arrays. Say there is an array of size 5. arr[2] = 3rd element. arr[-2] = Invalid Python has lists. Say there is a list of size list[2] = 3rd element. list[-2] = 2nd to last element. C PYTHON

11 New Things in Python Power function is ** Example: 3 ** 4 = 34
Multiplying strings Example: “Hello” * 2 = “HelloHello” Keyword: print is like cout but there is no “<<” needed Print automatically puts a new line to the end of the output, unless used a comma. Example:

12 New Things in Python raw_input([prompt]) is how you can extract the input stream (a.k.a. cin) But what about inputting an int?

13 Python’s Syntax No semicolons! No curly braces!
No parentheses for loops and conditionals! Python Traits: Colons are used in Python Everything is decided by indents This determines scope as well!

14 If / Elif / Else If / Else statements in C++ are similar to Python in logic, just not syntax. PYTHON C++

15 Loops While loops: For Loops:
Note: Index is not 0, 1, 2. Index refers to the actual object inside that list!

16 Questions?

17 Have a FANTASTIC Thanksgiving!

18 Extra Slides (Just for your information!)

19 Printing Variables Very similar to C, but not C++
You can always use the comma operator but it gets very tedious very fast. Instead, use: %s for string %d for int (doubles will get truncated) %f for floats (if you want to save decimals) Example:

20 Python functions Is Python pass by reference? Or value?
Python is… a bit of both! Python acts like pass-by-value when: Variable contains simple value like int Variable refers to object with no member function that can modify it (strings). Python acts like pass-by-reference when: Variable refers to an object with member functions that can modify it. In English… If it’s something simple like string or int, the answer is pass-by-value. You must return a new value to hold the answer. If it’s something like a list, then it’s pass- by-reference because a “list” has functions like .append() that changes it internally.


Download ppt "EECS 183 Discussion #9: It’s time to “Git” Python! November 22nd, 2016"

Similar presentations


Ads by Google