HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URL's added here will be added as <link>
s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
Any URL's added here will be added as <script>
s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
Search for and use JavaScript packages from npm here. By selecting a package, an import
statement will be added to the top of the JavaScript editor for this package.
Using packages here is powered by Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<head>
<meta name="viewport" content="width=device-width, initial-scale=1"></head>
<body>
<nav id="navbar">
<header id="nav"><h1>Python Documentation</h1></header>
<a class="nav-link"href="#Introduction">Introduction</a>
<a class="nav-link" href="#What_you_should_already_know">What you should already know</a>
<a class="nav-link"href="#Using_the_Python_Interpretor">Using the Python Interpretor</a>
<a class="nav-link" href="#Basics_of_Python">Basics of Python</a>
<a class="nav-link" href="#Control_Flow">Control Flow</a>
<a class="nav-link" href="#Functions">Functions</a>
<a class="nav-link" href="#Data_Structures">Data Structures</a>
</nav>
<main id="main-doc">
<section class="main-section" id="Introduction">
<header><h1 id="subheading">Introduction<h1></header>
<p class="para">Python is an interpreted high level dynamic programming language.It was created by Guido van Roossum and released in 1991.The main reason for its creation was to make programming easy and productive for programmers. <br><p class="para" style="font-size:1.6vw;">Reasons why you should use python are:</p><ol id="list1"><li id="points1">Less Application and development time</li </ol><li>Ease of reading</li><li> Reduced Learning time</li><li>It works on different platforms(Mac,Windows,Linux,Rasberry pie)</li><li>Has a simple syntax which is similiar to English</li></p>
</section>
<section class="main-section"id="What_you_should_already_know"><header><h1 id="subheading">What you should already know</h1></header><p class="para">Before starting Python you should know:<ol id="list1"><li>The basics of command line and how to run a program on your computer</li><li>How to install Python on your computer</li><li>The basics of programming</li></ol></p>
</section>
<section class="main-section" id="Using_the_Python_Interpretor">
<header><h1 id="subheading">Using the Python Interpretor</h1></header><p class="para"> To know how to use the Python interpretor visit:
<a id="external"href="https://realpython.com/interacting-with-python/" target="_blank">Using the Python Interpretor</a>
</p>
</section>
<section class="main-section" id="Basics_of_Python">
<header><h1 id="subheading">Basics of Python</h1></header>
<article id= "allbasics">
<article id="commentsection"><h3 id="articleheading">Comments</h3><p id="commentpara"class="para"> Python ignores the comment.
Comments are used to explain the Python code to the user to make the code more readable and accessable to the developer. They are also helpful in fixing bugs of the code or adding new features. As with comments you will know in which part of the code you made the mistake instead of going through the whole code to fix the problem.Many programming languages uses comments, python is not the first one.<br><b id="creatingcomment">Creating a comment</b><br> Comment starts with a # <br><code id="commentcode"> # </code> this is a comment symbol <br><code id=commentcode> #This is a comment example</code><br>Comments can also be place at end of line: <br><code id="print">print("helloWworld!")</code><code id="commentcode"># this is a comment</code><br> Comments can also be multilined:<br><code id=commentcode>#this is a comment <br>#Written in <br> #More than just one line</code> <br> you can also write multiline comments as : <br><code id="redcomment">""" <br> this is a a comment <br> Written in <br> more than just one line <br> """</code> </p></article>
</article>
<article id="variables"><h3 id="articleheading" >Variables</h3><p id="variables"class="para">Variable are container for storing data values.It is created the firt time you assign a data value to it there is no command you have to follow.<br><code id="variable">x=5<br>y="John"</code><br>These are both undeclared variable. Undeclared variables mean that their data types are not known.Variables do not need to be declared and can also be changed once declared. To declare a variable you use <b> casting </b><br>Casting Example:<br><code id="variable">x=str(3)<br> y=int(3) <br> z=float(3)</code><br> to get the Data type of a variable you use the <code id="type">type()</code> function.<br>python variabels are case sensitive <br><code id="variable">a=4</code> <br> is not the same as<br><code id="variable">A=4</code></p> <p id="variable_img"style="text-align:center;">Here is a indepth image describing variables <br> <img style="border-style:solid;"src="https://d2h0cx97tjks2p.cloudfront.net/blogs/wp-content/uploads/sites/2/2019/12/python-variable-and-data-types.jpg" ></p><p id="a" class="para">To learn more about Python Variables visit <a href="https://www.w3schools.com/python/python_variables.asp">Python Variables</a></p> </article>
</section>
<section class="main-section"id="Control_Flow">
<header><h1 id="subheading">Control Flow</h1></header><p id="controlflow"class="para">Control flow is the order of function calls,instructions and statements that is executed when a program is running.<br><p class="para"> Some of the common Control flow statements are:</p> <ol id="list1"
><li><b>if statement</b>:Which is executed only when the condition is true or else it doesnt run </li>
<li><b>for statments:</b>It is used for iterating over a sequence(List,tuple,dictionary,set,string)
</li> <li><b>range Function:</b>Returns a sequence of functions starting from 0 by default and increases by 1 and stop at a number specified by the developer.</li><li><b>While Loops</b>The code is executed until the condition is true then it stops.</li> </p>
</section>
<section class="main-section"id="Functions">
<header><h1 id="subheading">Functions</h1></header><p id="functions" class="para">A function is a block of code which is only runned when it is called. You pass data into a function The data is called a parameter they can be of any data type. The funtion either return the data or prints the data.<br> In python the function is defined using the <code id="def"> def </code> keyword.</p>
</section>
<section class="main-section"id="Data_Structures">
<header><h1 id=subheading>Data Structures</h1></header><p class="para">To Know about Data Structures visit: <br><a href="https://docs.python.org/3/tutorial/datastructures.html">Data Structures</a></p>
</section>
</main>></body>
*{
box-sizing:border-box;
}
body{
margin:0;
min-width:290px;
}
.nav-link{
display:block;
text-decoration:none;
color:black;
border-style:groove;
text-align:center;
padding:26px;
}
#navbar{
height:100%;
background-color:;
display:inline-block;
position:fixed;
top:0;
left:0;
overflow-x:hidden;
z-index:auto;
border-style:grove;
}
#nav{
color:black;
padding:26px;
border-style:groove;
display:inline-block;
}
#main-doc{
margin-left:350px;
min-width:290px;
overflow:scroll;
}
p{
color:black;
}
header{
color:black;
}
li{
color:black;
}
#external{
color:black;
}
#articleheading{
color:black;
text-align:center;
}
#commentcode{
color:green;
font-size:2vw;;
}
#redcomment{
color:red;
font-size:2vw;
}
#type{
color:blue;
}
#subheading{
margin-left:20px;
font-size:2vw;
}
.para{
margin-left:35px;
font-size:1.5vw;
margin-top:0
}
#list1{
margin-left:40px;
}
@media (max-width: 400px) {
#main-doc {
margin-left: -10px;
}
// !! IMPORTANT README:
// You may add additional external JS and CSS as needed to complete the project, however the current external resource MUST remain in place for the tests to work. BABEL must also be left in place.
/***********
INSTRUCTIONS:
- Select the project you would
like to complete from the dropdown
menu.
- Click the "RUN TESTS" button to
run the tests against the blank
pen.
- Click the "TESTS" button to see
the individual test cases.
(should all be failing at first)
- Start coding! As you fulfill each
test case, you will see them go
from red to green.
- As you start to build out your
project, when tests are failing,
you should get helpful errors
along the way!
************/
// PLEASE NOTE: Adding global style rules using the * selector, or by adding rules to body {..} or html {..}, or to all elements within body or html, i.e. h1 {..}, has the potential to pollute the test suite's CSS. Try adding: * { color: red }, for a quick example!
// Once you have read the above messages, you can delete all comments.
Also see: Tab Triggers