From 9a2daef5470e103b72eb271450c710fba7d269a4 Mon Sep 17 00:00:00 2001 From: Armen Vartan Date: Mon, 1 Dec 2014 17:13:14 -0500 Subject: [PATCH] py 1 --- python/1-js-variables/README.md | 17 ----------- python/1-js-variables/index.html | 18 ------------ python/1-js-variables/main.css | 36 ----------------------- python/1-js-variables/main.js | 8 ----- python/1-js-variables/reset.css | 47 ------------------------------ python/1-py-variables/README.md | 21 +++++++++++++ python/1-py-variables/variables.py | 0 7 files changed, 21 insertions(+), 126 deletions(-) delete mode 100644 python/1-js-variables/README.md delete mode 100644 python/1-js-variables/index.html delete mode 100644 python/1-js-variables/main.css delete mode 100644 python/1-js-variables/main.js delete mode 100644 python/1-js-variables/reset.css create mode 100644 python/1-py-variables/README.md create mode 100644 python/1-py-variables/variables.py diff --git a/python/1-js-variables/README.md b/python/1-js-variables/README.md deleted file mode 100644 index bfef93f..0000000 --- a/python/1-js-variables/README.md +++ /dev/null @@ -1,17 +0,0 @@ -###Javascript Variables, Lists and Objects - -Create a variable named byte and set it equal to "school". - -Create an array named instructors and have it contain the strings "Armen", "Chris", and "Greg" - -Create an array named students and have it contain the strings "Adolfo", "Benny", "Billy", "Brendan" - -Create an object with the following key-value pairs- "byteAcademy":byte, "instructors":instructors, "students":students - -Append the contents of the object to the "printout" div element. It should read like this: - -byteAcademy - School - -instructors - Armen, Chris, Greg - -students - Adolfo, Benny, Billy, Brendan diff --git a/python/1-js-variables/index.html b/python/1-js-variables/index.html deleted file mode 100644 index e71f366..0000000 --- a/python/1-js-variables/index.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - -
- -
-
- - - diff --git a/python/1-js-variables/main.css b/python/1-js-variables/main.css deleted file mode 100644 index 70a3e86..0000000 --- a/python/1-js-variables/main.css +++ /dev/null @@ -1,36 +0,0 @@ -body{ - background-color: #D1D1D1 -} - -nav{ - position: absolute; - background-color: black; - width: 100%; - height: 4em; - top: 0; - text-align: center; - line-height: 4em; -} - -nav h1{ - font-size: 3em; - font-family: monospace; - color: white; -} - -#printout{ - width: 800px; - min-height: 1000px; - background-color: white; - margin: 5em auto 0 auto; - color: black; - text-indent: 1em; -} - -#printout p{ - font-size: 2em; -} - -#printout p:nth-child(even) { - background-color: #D1D1D1; -} \ No newline at end of file diff --git a/python/1-js-variables/main.js b/python/1-js-variables/main.js deleted file mode 100644 index 2be4586..0000000 --- a/python/1-js-variables/main.js +++ /dev/null @@ -1,8 +0,0 @@ -// set your variables below - -// all jquery dom actions can only be called inside document ready. Print your variables -// inside document ready. - -$(document).ready(function(){ - -}) \ No newline at end of file diff --git a/python/1-js-variables/reset.css b/python/1-js-variables/reset.css deleted file mode 100644 index af5d7e5..0000000 --- a/python/1-js-variables/reset.css +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Eric Meyer's Reset CSS v2.0 (http://meyerweb.com/eric/tools/css/reset/) - * http://cssreset.com - */ -html, body, div, span, applet, object, iframe, -h1, h2, h3, h4, h5, h6, p, blockquote, pre, -a, abbr, acronym, address, big, cite, code, -del, dfn, em, img, ins, kbd, q, s, samp, -small, strike, strong, sub, sup, tt, var, -b, u, i, center, -dl, dt, dd, ol, ul, li, -fieldset, form, label, legend, -table, caption, tbody, tfoot, thead, tr, th, td, -article, aside, canvas, details, embed, -figure, figcaption, footer, header, hgroup, -menu, nav, output, ruby, section, summary, -time, mark, audio, video { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - font: inherit; - vertical-align: baseline; -} -/* HTML5 display-role reset for older browsers */ -article, aside, details, figcaption, figure, -footer, header, hgroup, menu, nav, section { - display: block; -} -body { - line-height: 1; -} -ol, ul { - list-style: none; -} -blockquote, q { - quotes: none; -} -blockquote:before, blockquote:after, -q:before, q:after { - content: ''; - content: none; -} -table { - border-collapse: collapse; - border-spacing: 0; -} \ No newline at end of file diff --git a/python/1-py-variables/README.md b/python/1-py-variables/README.md new file mode 100644 index 0000000..74673aa --- /dev/null +++ b/python/1-py-variables/README.md @@ -0,0 +1,21 @@ +Python Variables, Lists and Dictionaries +======================================== + +Create a variable named byte and set it equal to "school". + +Create a [list](http://www.tutorialspoint.com/python/python_lists.htm) named instructors and have it contain the strings "Armen", "Chris", and "Greg" + +Create an [tuple](http://www.tutorialspoint.com/python/python_tuples.htm) named students and have it contain the strings "Adolfo", "Benny", "Billy", "Brendan" + +What's the difference between a list and a tuple? Why use one over the other? + +Create a dictionary with the following key-value pairs- "byteAcademy":byte, "instructors":instructors, "students":students + +Print the keys and values of the dictionary. It should look like this: +``` +byteAcademy - School +instructors - Armen, Chris, Greg +students - Adolfo, Benny, Billy, Brendan +``` +Look into iterating over dictionaries in Python. +Check out [.format](https://infohost.nmt.edu/tcc/help/pubs/python/web/new-str-format.html) diff --git a/python/1-py-variables/variables.py b/python/1-py-variables/variables.py new file mode 100644 index 0000000..e69de29