Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finished Project #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
44 changes: 44 additions & 0 deletions Automate Your Page/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/* In all HTMl file */
* {
font-family: Helvetica;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}

/* Headerpage in the HTMl file */
#pageheader {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In CSS, there is no reason to use an id selector over a class selector. CSS class selectors are better in every way, even if you only use it once.

font-weight: bold;
color: white;
background: #1A1A80;
border-radius: 0.3125em;
padding-left: .2em;
}

.sectiontitle {
text-decoration: underline;
}

/* All lessons in the HTMl file */
.lesson {
background: #1A1A80;
padding: 0.3125em;
border-radius: 0.3125em;
color: white;
margin-bottom: .2em;
}

/* All notes in the HTMl file */
.note {
background-color: #D6F5FF;
border-radius: 0.3125em;
padding: .2em;
margin: .2em;
color: black;
}

/* All examples in the HTMl file */
.example {
font-weight: bold;
}
31 changes: 31 additions & 0 deletions Automate Your Page/html_generator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""This set of functions takes an input, notes, formatted in a list with lists containing the title and notes"""

#List
notes = ["Lists", "Lists are one of the most powerful storage containers in Python. They are a mutable structure that can hold things like variables, numbers, strings and even other lists. Individual aspects of a list can be changed while not becoming a new, copied list."], ["Index", "Indexing in lists grabs the position of an element in a list. You can using slicing with these indexes to grab certain items in a list."], ["Mutation vs Copied", "While lists can be mutated they can also be copied and will be with certain functions. When concatenating two lists a new list is created to hold the elements. Changing specific values at certain indexes or using a function such as .append mutates the list into holding new or more elements."], ["Finding Length", "To find the length of an element such as a string or list the 'len' function is used. It will return the number of items in a list or characters in a string."], ["In", "The function 'in' is used in a boolean fashion. If x can be found in y, True will be returned. Otherwise it will return False. This can be used to find a certain word in a long string or a certain element in a list."], ["Devensive Programming", "Defensive programming is the practice of desigining code so that it can deal with circumstances that were unintended and allows for the program to continue running instead of crashing."], ["Problem Solving", "Problem solving is a vital process to coding. When trying to figure out how to code or deal with a problem, you need to break it down into several steps. Figure out the input and the output. Write some pseudocode to get an idea of how to structure the code. Then you pick the foundation of the code and begin. After every part extensive testing should be done to ensure the code functions as intended."]

#Function than show the concepts
def html_note_structure(concept):
"""Puts together a title and note into an html structure"""
html1 = """<div class="note">
<h3>""" + concept[0]
html2 = """</h3>
<p>
""" + concept[1]
html3 = """
</p>
</div>

"""

return html1 + html2 + html3

def much_html(concepts):
"""Repeats html_note_structure until all of notes has been structured"""
HTML = ""
#Loop for the Concepts
for concept in concepts:
HTML += html_note_structure(concept)
return HTML

#print the HTML structure in the console
print much_html(notes)
Loading