py 1
This commit is contained in:
parent
c07d7f9c4c
commit
9a2daef547
@ -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
|
|
@ -1,18 +0,0 @@
|
|||||||
<!doctype HTML>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<link rel="stylesheet" type="text/css" href="reset.css">
|
|
||||||
<link rel="stylesheet" type="text/css" href="main.css">
|
|
||||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
|
|
||||||
<script type="text/javascript" src="main.js"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class = "container">
|
|
||||||
<nav id="top">
|
|
||||||
<h1>Javascript Variables and Objects</h1>
|
|
||||||
</nav>
|
|
||||||
<div id = "printout"></div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
@ -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;
|
|
||||||
}
|
|
@ -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(){
|
|
||||||
|
|
||||||
})
|
|
@ -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;
|
|
||||||
}
|
|
21
python/1-py-variables/README.md
Normal file
21
python/1-py-variables/README.md
Normal file
@ -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)
|
0
python/1-py-variables/variables.py
Normal file
0
python/1-py-variables/variables.py
Normal file
Loading…
x
Reference in New Issue
Block a user