Skip to content

Instantly share code, notes, and snippets.

@adeisbright
Last active March 12, 2022 19:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adeisbright/6e335e005c33303cced03760a0672da3 to your computer and use it in GitHub Desktop.
Save adeisbright/6e335e005c33303cced03760a0672da3 to your computer and use it in GitHub Desktop.
Get started with the basics of python

Bigjara Python : A Beginner Focused Approach

Lesson 1 : Getting Started

The lesson link

Lesson 2 : Comments and Variables

The lesson link

Lesson 3 : Operators

The lesson link

Lesson 4 : Conditionals

The lesson link

Lesson 5 : Repetition

The lesson link

Lesson 6 : A Console Project on FizzBuzz

The lesson link

Assignment on first set of lessons

Write a program that prints the first 100 members of the sequence 2 , -3 , 4 , -5 , 6

Write a program that generates this sequence 0 , 5 , 10 , 15 , 20 , 25, ..., 80

Write a program that grades a student using this grading system :

Score Grade

80 – 100 A

60 – 79 B

50 – 59 C

35 – 49 D

0 – 34 F

Create variables to store the following information about a user with the following detail : Gender : f Age : 35

country of origin : Burundi

Covid Patient : No

Networth : 250,000

Second Set of Lessons on Python

Lesson 7 : Working with List

List Lesson: Module 1

List Lesson: Module 2

Lesson 8 : Tuple

The lesson link

Lesson 9 : Set

The lesson link

Lesson 10 : Dictionary

The lesson link

@adeisbright
Copy link
Author

from http.server import BaseHTTPRequestHandler, HTTPServer


hostName = "localhost"
serverPort = 8080

class Server(BaseHTTPRequestHandler):
    def do_GET(self):
        self.send_response(200)
        self.send_header("Content-type", "text/html")
        self.end_headers()
        self.wfile.write(bytes("""
        <html><head><title>Getting Started</title></head>
        <body>
            <p>Hello , World</p>
        </body>
        </html>
        """, "utf-8"))

if __name__ == "__main__":        
    webServer = HTTPServer((hostName, serverPort), Server)
    print("Server started http://{}:{}".format(hostName, serverPort))

    try:
        webServer.serve_forever()
    except KeyboardInterrupt:
        webServer.server_close()
        print("Server stopped.")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment