Merge remote-tracking branch 'sami/master'
This commit is contained in:
commit
ca3bfc63a0
10 changed files with 55 additions and 7 deletions
28
sami/django/#django.org#
Normal file
28
sami/django/#django.org#
Normal file
|
@ -0,0 +1,28 @@
|
|||
*** Django #1: Introduction
|
||||
**** Objective
|
||||
- We will build a IPv6 ULA registry with Django in the
|
||||
next lectures
|
||||
**** Lecture content
|
||||
- Create a new directory in your learning cirle repository named "django"
|
||||
- Write down the answers to the following questions in django/django.org
|
||||
- Research and answer the following questions: (1/2 of the time)
|
||||
- What is IPv6 ULA?
|
||||
- addresses that are only ment to be used in privte segment.
|
||||
- unique Local address they can be easly identified by FD00::/8
|
||||
- equivllent to privte address in v4
|
||||
- Which registries did exist historically?
|
||||
- How should an IPv6 ULA registry work?
|
||||
- Get started with Django
|
||||
- Create a new python virtual env using `python3 -m venv`
|
||||
- Create the venv in django/venv
|
||||
- Create a file .gitignore in django/
|
||||
- Add 'venv/' (without the quotes to that file
|
||||
- Use magit to verify that the venv is being ignored
|
||||
- Add and commit the .gitignore file
|
||||
- Inside this virtual env, install django using `pip`
|
||||
- Go to https://www.djangoproject.com/
|
||||
- Finish tutorial 1: https://docs.djangoproject.com/en/3.0/intro/tutorial01/
|
||||
- Commit the django code to your repository
|
||||
- Exclude '*.pyc' in the .gitignore
|
||||
- Also exclude the sqlite database
|
||||
|
1
sami/django/.#django.org
Symbolic link
1
sami/django/.#django.org
Symbolic link
|
@ -0,0 +1 @@
|
|||
sami@afro-linux-lenovo-b50-30.13724:1593172229
|
5
sami/django/.gitignore
vendored
Normal file
5
sami/django/.gitignore
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
venv
|
||||
|
||||
*.pyc
|
||||
|
||||
|
1
sami/django/env/bin/python
vendored
Symbolic link
1
sami/django/env/bin/python
vendored
Symbolic link
|
@ -0,0 +1 @@
|
|||
python3
|
1
sami/django/env/bin/python3
vendored
Symbolic link
1
sami/django/env/bin/python3
vendored
Symbolic link
|
@ -0,0 +1 @@
|
|||
/usr/bin/python3
|
1
sami/django/env/lib64
vendored
Symbolic link
1
sami/django/env/lib64
vendored
Symbolic link
|
@ -0,0 +1 @@
|
|||
lib
|
3
sami/django/env/pyvenv.cfg
vendored
Normal file
3
sami/django/env/pyvenv.cfg
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
home = /usr/bin
|
||||
include-system-site-packages = false
|
||||
version = 3.7.5
|
|
@ -1 +0,0 @@
|
|||
sami@afro-linux-lenovo-b50-30.18673:1593006374
|
|
@ -29,13 +29,14 @@ questions = [
|
|||
Question(question_prompts[9], "a"),
|
||||
]
|
||||
|
||||
def run_quiz(questions):
|
||||
def quiz(questions):
|
||||
score = 0
|
||||
for question in questions:
|
||||
answer = input(question.prompt)
|
||||
if answer == question.answer:
|
||||
score += 5
|
||||
print("Correct! Your score is", score,)
|
||||
|
||||
|
||||
else:
|
||||
print("Incorrect!")
|
||||
|
@ -43,11 +44,18 @@ def run_quiz(questions):
|
|||
print("You lost 3 points!")
|
||||
print ("Score: ", score)
|
||||
print ("\n")
|
||||
|
||||
|
||||
|
||||
# Final stage
|
||||
score = 0
|
||||
if score >= -30:
|
||||
print("Your total score is:", score, "- You suck!")
|
||||
|
||||
elif score == 10 or 15 :
|
||||
print("Your total score is:", score, "- You went ok!")
|
||||
|
||||
else:
|
||||
print("Your total score is:", score, "- You are awesome!")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
run_quiz(questions)
|
||||
quiz(questions)
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Subproject commit a0012ef6c4d44c875a3173fc746ab0a9259bc531
|
Loading…
Reference in a new issue