Hack My Planet

Day 13

(Final) Python Review

  • Functions
  • Parameters
  • For loops
  • Lists
  • Indices

Function Review

  • Write a function that takes in a list of magicians' names as a parameter. The function should modify the list by adding the phrase "The Great" to each magician's name. Call the function then print the list to test it out.
    • Either increment a number, or
    • Use the len(list) function, which returns an integer that is the length of the given list.

Function Review

  • Write a function that takes in a list and a number, n, as a parameter, and deletes n items from the beginning of the given list. DO NOT RETURN OR PRINT ANYTHING IN THE FUNCTION
    • Test your function by making a list, and calling the function on it. Then print the list
    • Use the remove() function. list.remove(item). It searches the list for the given items and removes it
  • Modify the above function to delete n items from the end of the list

Server

New Command Line commands

  • telnet
    • Connect and communicate with a host
    • This is how you can directly interact with servers and sockets
  • git
    • Version control system used for software development
    • GitHub is a web-based Git repository hosting service where people can share their source code and have other people help them
  • ifconfig
    • provides information regarding your internet connection

Magic Eight Ball

  • cd Downloads
  • git clone http://github.com/junior-devleague/magic-eight-ball-socket
  • cd magic-eight-ball-socket
  • git checkout step1
  • git pull
  • git fetch
Made with Slides.com