Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

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.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

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.

+ add another resource

Packages

Add Packages

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.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>

<!-- 
Maryan's Technical Documentation Page
-->
<style>
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100&display=swap');
</style>
<!-- Navigation bar -->

<nav id="navbar">
  <header> Python Programming </header>
  <ul>
    <li><a class="nav-link" href="#introduction_to_python">Introduction to Python</a></li>
    <li>
      <a class="nav-link" href="#getting_started"
        >Getting Started</a
      >
    </li>
    <li>
      <a class="nav-link" href="#video_guides_and_tutorials">Video guides and tutorials</a>
    </li>
    <li><a class="nav-link" href="#advantages_and_disadvantages_to_using_python">Advantages and disadvantages to using python</a></li>
     <li><a class="nav-link" href="#why_is_python_the_easiest_coding_language_for_beginners">Why is Python the easiest coding language for beginners</a></li>
    <li><a class="nav-link" href="#example_code">Example code</a></li>
     <li><a class="nav-link" href="#python_syntax_compared_to_other_programming_languages">Python syntax compared to other programming languages</a></li>
     <li><a class="nav-link" href="#reference">Reference</a></li>
  </ul></nav>
  
  <main id="main-doc">
    <!-- Introduction section -->
    <section class="main-section" id="introduction_to_python">
      <header>Introduction to Python</header>
      <article><p>Python is one of the most widely used programming languages. Guido van Rossum produced it, and it was published in 1991.</p><article>
    </section>
     <section class="main-section" id="getting_started">
      <header>Getting Started</header>
      <article><p> It's easy to get started. Welcome! Are you completely new to programming? If not then we presume you will be looking for information about why and how to get started with Python. Fortunately an experienced programmer in any programming language (whatever it may be) can pick up Python very quickly. It's also easy for beginners to use and learn, so jump in!

<h2>Installing</h2>
<p>Installing Python is generally easy, and nowadays many Linux and UNIX distributions include a recent Python. Even some Windows computers (notably those from HP) now come with Python already installed. If you do need to install Python and aren't confident about the task you can find a few notes on the BeginnersGuide/Download wiki page, but installation is unremarkable on most platforms.</p>

        <h2>Learning</h2>
<p>Before getting started, you may want to find out which IDEs and text editors are tailored to make Python editing easy, browse the list of introductory books, or look at code samples that you might find helpful.</p>

<p>There is a list of tutorials suitable for experienced programmers on the BeginnersGuide/Tutorials page. There is also a list of resources in other languages which might be useful if English is not your first language.</p>

<p>The online documentation is your first port of call for definitive information. There is a fairly brief tutorial that gives you basic information about the language and gets you started. You can follow this by looking at the library reference for a full description of Python's many libraries and the language reference for a complete (though somewhat dry) explanation of Python's syntax. If you are looking for common Python recipes and patterns, you can browse the ActiveState Python Cookbook</p>
      
    </section>
    <!-- Video -->
     <section class="main-section" id="video_guides_and_tutorials">
      <header>Video guides and tutorials</header>
      <p>The following video by Freecodecamp gives you an introduction into Python</p>
      <iframe width="560" height="315" src="https://www.youtube.com/embed/rfscVS0vtbw" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
       </section>
       <!-- The advantages and disadvantages section -->
       <section class="main-section" id="advantages_and_disadvantages_to_using_python">
      <header>Advantages and disadvantages to using Python</header>
      <p>Just like any other programming language-python has some advantages and disadvatages</p>
         <h1>Advantages</h1>
         <ul>
           <li>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Id itaque libero exercitationem quibusdam recusandae quisquam magni iure odit obcaecati quis.</li> 
           <li>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Impedit laborum error debitis, ullam ut quis eos. Nesciunt ratione omnis consequatur.</li> 
           <li>Lorem ipsum dolor sit amet consectetur adipisicing elit. Praesentium, autem?</li> 
           <li>Lorem ipsum dolor sit amet consectetur adipisicing elit. Consequatur optio ex provident, voluptate iste similique veritatis soluta odio veniam quisquam?</li> 
         </ul>       
         <h1>Disadvantages</h1>
         <ul>
           <li>Lorem ipsum dolor sit amet consectetur adipisicing elit. Impedit eligendi doloribus explicabo iure inventore cupiditate officia officiis esse at eaque!</li> 
           <li>Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit excepturi odit, magni saepe obcaecati animi.</li> 
           <li>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Rem, tenetur!</li> 
           <li>Lorem ipsum dolor sit amet consectetur adipisicing elit. Repudiandae, velit.</li> 
         </ul>
         </section>
       <!-- Why is python easiest -->
      <section class="main-section" id="why_is_python_the_easiest_coding_language_for_beginners">
        <header>Why is Python the easiest coding language for beginners</header>
        <p>Python works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc).
Python has a simple syntax similar to the English language.
Python has syntax that allows developers to write programs with fewer lines than some other programming languages.
Python runs on an interpreter system, meaning that code can be executed as soon as it is written. This means that prototyping can be very quick.
Python can be treated in a procedural way, an object-oriented way or a functional way.</p>
    </section>
       <!-- examples of code in python -->
       <section class="main-section" id="example_code">
         <header>Example code</header>
                  <ul>
           <li> <p>Hello World Example</p>
             <code> print("Hello, World!")</code></ul></li>
        <ul><li> <p> Dice roller example example</p>
         <code>import random
min = 1
max = 6

roll_again = "yes"

while roll_again == "yes" or roll_again == "y":
    print "Rolling the dices..."
    print "The values are...."
    print random.randint(min, max)
    print random.randint(min, max)

           roll_again = raw_input("Roll the dices again?")</code></li>
         </ul>
         <ul><li><p>Guessing game</p>
         <code>import random
n = random.randint(1, 99)
guess = int(raw_input("Enter an integer from 1 to 99: "))
while n != "guess":
    print
    if guess < n:
        print "guess is low"
        guess = int(raw_input("Enter an integer from 1 to 99: "))
    elif guess > n:
        print "guess is high"
        guess = int(raw_input("Enter an integer from 1 to 99: "))
    else:
        print "you guessed it!"
        break
           print</code></li></ul>
           <ul><li><p>Number reverser example</p>
           <code>n=int(input("Enter number: "))
rev=0
while(n>0):
    dig=n%10
    rev=rev*10+dig
    n=n//10
             print("Reverse of the number:",rev)</code></ul></li>
           <ul><li><p>Average score calculator example</p>
           <code># Get three test score
round1 = int(raw_input("Enter score for round 1: "))

round2 = int(raw_input("Enter score for round 2: "))

round3 = int(raw_input("Enter score for round 3: "))
   
# Calculate the average
average = (round1 + round2 + round3) / 3

# Print out the test score
             print "the average score is: ", average </code></ul></li>
         </section>
         <!-- How is python in comparison -->
       <section class="main-section" id="python_syntax_compared_to_other_programming_languages">
         <header>Python syntax compared to other programming languages</header>
         <article><p>Python was designed for readability, and has some similarities to the English language with influence from mathematics.
Python uses new lines to complete a command, as opposed to other programming languages which often use semicolons or parentheses.
Python relies on indentation, using whitespace, to define scope; such as the scope of loops, functions and classes. Other programming languages often use curly-brackets for this purpose.</p></article>
    </section>
    <!-- Where did I get the information from -->
  <section class="main-section" id="reference">
    <header>Reference</header>
    <article>
      <ul>
        <li>
          All the documentation in this page is taken from
          <a
            href="https://www.w3schools.com/python/python_intro.asp"
            target="_blank"
            >w3school</a
          >
        </li>
        and
        <a
           href="https://python.org"
           target="_blank"
           >Python<a/>
          </li>       
      </ul>
    </article>
  </section>
  </main>
  
</div>
              
            
!

CSS

              
                
body{
  {color: #000000;
  mid-width: 300px;
  background-color: white;
  font-family: "poppins", san-serif, arial;
  Line-height: 2;
    padding-top: 60px;}
@media screen and (min-width:768px) and (max-width:991px) {
    body {
        margin-top:100px;
    }
}
@media screen and (min-width:992px) and (max-width:1199px) {
    body {
        margin-top:50px;
    }
}
}
nav {
  background-color: white; 
  display:inline-block;
  color:#000000;
  display: inline-block;
 
}
#nav span {
        display: inline-block;
  position: relative;}

nav ul {
  padding: 10px, 20px;
  display:inline-block;
  justify-content: center;
  list-style: none;
  max-width: 150px;
}
nav ul li {
  text-decoration: none;
  font-size: 12px;
  color: black;
  max-width: 150px;
  display:inline-block;
}
nav ul li:hover {
  background-color: blue;
  transition: 0.9s;
}

@media only screen and (max-width: 813px) {
  /* For mobile phones: */
  #navbar {
    float:left;
    margin: 0px;
    border: 1px solid;
    height: 500px;
    align-items: fixed;}
    
}
#navbar { 
float: left;
display:inline-block;
padding: 10px, 20px;
color: blue;
text-decoration: none;
cursor: pointer;
position: absolute;
top: 0;
padding: 0;
margin: 0;
width: 20%;
max-height: 500px;
border: none;
z-index: -1;
border-bottom: none;
position: fixed;
}
.nav-links {
  position: fixed;
  top: 0;
  left:0;
  z-index: 2;
  height: 100vh;
  width: 250px;
  background:white;
  
}
.nav-link{
display: flex;
align-items: center;
color: black;
font-weight: bold;
font-sixe: 14px;
text-decoration:none;
padding: 12px 15px;
}

.nav-link {
margin-right: 15px;
  
}

.nav-link--active {
  color: #009578;
  background: #eeeeee;
}
header {
  color: #000000;
  margin: 5px;
  font-align: center;
  font-size: 1.5em;
}
 #main-doc {
    position: relative;
    margin-left: 275px;
    margin-top: 0px;
    color: #000000;
  }
}

@media only screen and (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;}

#main-doc header {
  Color: #000000;
  margin: 0px;
  font-align: center;
  font-size: 2em;
  text-aligh: left;
}
  
}

h1 {
  Color: #000000;
  margin: 0px;
  font-align: center;
  font-size: 15px;
  text-aligh: left;
}
h2 {
  Color: #000000;
  margin: 0px;
  font-align: center;
  font-size: 15px;
  text-aligh: left;
}

              
            
!

JS

              
                // !! 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. 

              
            
!
999px

Console