Skip to content

Instantly share code, notes, and snippets.

@andrefqms
Created January 8, 2019 13:10
Show Gist options
  • Save andrefqms/d81b813c6cc7cd46153722a95f4e595d to your computer and use it in GitHub Desktop.
Save andrefqms/d81b813c6cc7cd46153722a95f4e595d to your computer and use it in GitHub Desktop.
A Technical Documentation Pagee
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
<html>
<nav id="navbar">
<header>Python Documentation</header>
<ul>
<a class="nav-link" href="#Introduction" rel="internal"><li>Introduction</li></a>
<a class="nav-link" href="#About_this_guide" rel="internal"><li>About this guide</li></a>
<a class="nav-link" href="#What_can_Python_do?" rel="internal"><li>What can Python do?</li></a>
<a class="nav-link" href="#Hello_world" rel="internal"><li>Hello World</li></a>
<a class="nav-link" href="#Variables" rel="internal"><li>Variables</li></a>
<a class="nav-link" href="#if...else_statements" rel="internal"><li>if...else statements</li></a>
<a class="nav-link" href="#References" rel="internal"><li>References</li></a>
</ul>
</nav>
<main id="main-doc">
<section class="main-section" id = "Introduction">
<header><strong>Introduction</strong></header>
<article>
<p>Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Python’s elegant syntax and dynamic typing, together with its interpreted nature, make it an ideal language for scripting and rapid application development in many areas on most platforms.</p>
<p>The Python interpreter and the extensive standard library are freely available in source or binary form for all major platforms from the Python Web site, https://www.python.org/, and may be freely distributed. The same site also contains distributions of and pointers to many free third party Python modules, programs and tools, and additional documentation.</p>
<p>The Python interpreter is easily extended with new functions and data types implemented in C or C++ (or other languages callable from C). Python is also suitable as an extension language for customizable applications.</p>
<p>This tutorial introduces the reader informally to the basic concepts and features of the Python language and system. It helps to have a Python interpreter handy for hands-on experience, but all examples are self-contained, so the tutorial can be read off-line as well.</p>
</artice>
</section>
<section class="main-section" id = "About_this_guide">
<header ><strong>About this guide</strong></header>
<article>
<p>This tutorial does not attempt to be comprehensive and cover every single feature, or even every commonly used feature. Instead, it introduces many of Python’s most noteworthy features, and will give you a good idea of the language’s flavor and style. After reading it, you will be able to read and write Python modules and programs, and you will be ready to learn more about the various Python library modules described in The Python Standard Library.</p>
</artice>
</section>
<section class="main-section" id ="What_can_Python_do?">
<header><strong>What can Python do?</strong>
</header>
<article>
<p><strong>Examples:</strong></p>
<li>Python can be used on a server to create web applications.</li>
<li>Python can be used alongside software to create workflows.</li>
<li>Python can connect to database systems. It can also read and modify files. </li>
<li>Python can be used to handle big data and perform complex mathematics.
</li>
<li>Python can be used for rapid prototyping, or for production-ready software development.
</li>
</artice><br>
<section class="main-section" id="Hello_world">
<header class="header-title"><strong>Hello world</strong></header>
<p class="passages">
<pre><code>
# This code prints "Hello, world!".
print('Hello, world!')
</code></pre>
</p>
</section>
<section class="main-section" id="Variables">
<header><strong>Variables</strong></header>
<p class="passages">
Unlike other programming languages, Python has no command for declaring a variable.<br>
A variable is created the moment you first assign a value to it.<br>
<span class="subtitle">Example:</span><br>
<pre><code>
x = 5
y = "John"
print(x)
print(y)
</code></pre><br>
Variables do not need to be declared with any particular type and can even change type after they have been set.<br>
<pre><code>
x = 4 # x is of type int
x = "Sally" # x is now of type str
print(x)
</code></pre>
</p>
<section class="main-section" id="if...else_statements">
<header><strong>if...else statements</strong></header>
<p class="passages">
Decision making is required when we want to execute a code only if a certain condition is satisfied.<br>
The if…elif…else statement is used in Python for decision making.<br>
<span class="subtitle">if syntax</span><br>
<pre><code>
if test expression:
statement(s)
</code></pre><br>
<span class="subtitle">Example</span><br>
<pre><code>
# If the number is positive, we print an appropriate message
num = 3
if num > 0:
print(num, "is a positive number.")
print("This is always printed.")
num = -1
if num > 0:
print(num, "is a positive number.")
print("This is also always printed.")
</code></pre><br>
</p>
<section class="main-section" id="References">
<header class="header-title" ><strong>References</strong></header><br>
<p class="passages" id="resources">
<a href="https://www.python.org/" target="_blank" title="Python Offical Website">Python Offical Website</a><br>
<a href="https://docs.python.org/3/" title="Python documentation">Python Documentation</a><br>
<a href="https://en.wikipedia.org/wiki/Python_(programming_language)" title="Python Wikipedia" target="_blank">Python (Wikipedia)</a><br>
<a href="https://wiki.python.org/moin/PythonBooks" tabindex="_blank" title="Python Books">Python Books</a><br>
<a href="https://www.w3schools.com/python/" title="Python videos" target="_blank">Python Tutorial
W3Schools</a><br>
</p>
</section>
</main>
</div>
</div>
<div id="top"><a href="#navbar">TOP ⇑</a></div>
</body>
</html>
html,body{
color: black;
background-color: #ffffff;
font-family: Arial,sans-serif;
}
#navbar{
position:fixed;
min-width:290px;
top:0px;
left:0px;
height:100%;
border-right:solid;
}
header{
color:black;
font-size: 30px;
margin:10px;
text-align:center;
font-size:1.8em;
font-weight:thin;
}
#navbar ul{
height:88%;
overflow-y:auto;
overflow-x:hidden;
}
#navbar a{
color: #4d4e53;
text-decoration:none;
cursor:pointer;
}
#main-doc{
margin-left:310px;
padding:20px;
}
section article{
color: black;
margin:15px;
font-size:0.96em;
font-weight: 540;
}
section li {
margin-left:15px;
}
code{
display:block;
position: relative;
background-color:lightgray;
padding:15px;
border-radius:5px;
}
@media (max-width: 400px) {
#main-doc{
margin-left:-10px;
}
code{
margin-left:-20px;
width:100%;
padding:15px;
padding-left:10px;
padding-right:45px;
min-width:233px;
}
}
#top{
text-align: right;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment