Cache the Knowledge, Master the Code

student-vote.py
# This program asks the user for their name and age and then asks them who they are voting for,
# if they are old enough to vote
# take the user's name
name=input("What is your name?")
print("Hello", name)
# take the user's age
age=int(input("How old are you?"))
print("You are", age, "years old")
# Check if the age is valid
if age>=18:
print("You are old enough to vote")
vote = input("Who are you voting for (Labour/Conservative/Lib Dem/Green/Independent Candidate)?")
# Check if the vote is valid
while (vote !="Labour") and (vote !="Conservative") and (vote !="Lib Dem") and (vote !="Green") and (vote !="Independent Candidate"):
print("Invalid party")
vote = input("Who are you voting for (Labour/Conservative/Lib Dem/Green/Independent Candidate)?")
print("You are voting for", vote)
# If the age is not valid
else:
print("You are not old enough to vote")
print("Goodbye", name)

Introduction

Getting Started

Welcome to ProgressBytes. Before get started with your coding journey learn how to get the best out of this site to support your understanding of computer programming.

Programming is a Practice

If you want to get good at programming you will need practice. You should aim to do a couple of hours a week at least on top of your normal classroom study. If you wanted to be a professional footballer you would need to train daily for about an hour.

The same can be said for programming. If you want to be a professoinal then look to solve a problem for an hour a day with a couple of days of rest.

You should aim to follow a project based learning approach. Use this site to get your core knowledge and as a point of reference. Then solve programming challenges to further emebed that knowledge.

Each challenge you do should build upon your previous experience.

Using this Site

This site is designed as a point of reference. You can read it from the start to end, or you can dip in and out as you like. I imagine you will likely read a page at a time then complete challenges.

Search docs

Use the Search Docs at the top of the site to go straight to key concepts

Images


Guidance Call Outs

Look out for these guidance call outs, they will help you with key definition or important information.

Definition: Something to Learn

This is a Definition callout. You will see this where there is a key definition you should learn for the exam.


Alert: Something Important

This is an alert callout. You will see this where there is something important for you to be aware of.


Useful External Resources

Advanced IDE: VS Code

You will need to use an IDE to get practical experience of programming for this part of the course.

Craig and Dave

Access videos to support your learning from Craig and Dave here

Learning Python with W3-Schools

Use W3-schools to get an understanding of core concepts without the need for an IDE