Three Mini Projects Python Programming · Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Mini Projects
Should a quiz accept PaRiS for paris? How do you find the fault in your own program?
- Plan each project with a table of expected answers
- Build a guessing game, a quiz and a grade book
- Find the fault in your own programs with a checklist
4Lessons14Problems6Python Labs1Question Set1Mock Test Functions: Name a Recipe Python Programming · Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Functions
What does return do that print cannot? Why does a variable vanish after a function?
- Define functions with values, return and defaults
- Learn where a variable lives
- Test a function with a table of cases
6Lessons14Problems8Python Labs1Question Set1Mock Test Lists: Many Values in One Variable Python Programming · Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Lists, Loops
After b = a, why does changing b also change a?
- Make lists and read them by position and slice
- Add, remove, sort and loop through items
- Find totals and averages, and make a table of lists
5Lessons15Problems8Python Labs1Question Set1Mock Test Repeat Until: while Loops Python Programming · Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Loops
Why does a loop sometimes never stop? How do you leave a loop early?
- Write while loops and learn what makes them stop
- Use break and continue, and ask again and again
- Find endless loops and build a guessing game
5Lessons14Problems9Python Labs1Question Set1Mock Test Repeat with for: Loops Python Programming · Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Loops
Why does range(1, 6) stop at 5? Can a loop add 1 to 100 for you?
- Repeat lines with for and range()
- Build a sum, a count or a factorial with a loop
- Put one loop inside another to print tables and patterns
5Lessons14Problems8Python Labs1Question Set1Mock Test And, Or, Not: Combining Conditions Python Programming · Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Conditionals: if, elif, else
Is every year divisible by 4 a leap year? Who gets into the club without a ticket?
- Combine conditions with and, or and not
- Check a range and ask if a value is in a group
- Prove a condition with a truth table
5Lessons13Problems7Python Labs1Question Set1Mock Test If, Elif, Else: Making Decisions Python Programming · Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Conditionals: if, elif, else
Why does if x = 5: give an error? Where do mistakes in a decision hide?
- Compare values and run lines only when True
- Choose between two, then between many
- Test every branch and build a ticket office
5Lessons13Problems8Python Labs1Question Set1Mock Test Install and Run Python at Home Python Programming · Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Getting Started with Python
Do you need to install Python to learn it? Why does Windows say python is not recognized?
- Install Python on Windows, macOS or Linux
- Write a program as a file and run it
- Fix the problems most beginners meet
4Lessons13Problems5Python Labs1Question Set1Mock Test Words and Text: Strings Python Programming · Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Strings
How do you write a word backwards? Why can you not change one letter of a string?
- Count, pick out and slice letters
- Clean, join and change the case of text
- Use f-strings and build a name tag maker
5Lessons13Problems8Python Labs1Question Set1Mock Test Ask and Answer: input() Python Programming · Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Input and Output
Why can 3 plus 4 give 34? How do friends split a bill fairly?
- Ask with input() and turn the answer into a number
- Build a temperature converter and a tip calculator
- Make a unit converter and a bill splitter
4Lessons13Problems8Python Labs1Question Set1Mock Test Python as a Calculator Python Programming · Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Operators and Expressions
Why does 4 / 2 give 2.0? Why is 2 + 3 * 4 equal to 14?
- Use whole-number division, the remainder and powers
- Learn which sign Python works out first
- Build a change maker and a clock with round, abs and divmod
5Lessons13Problems8Python Labs1Question Set1Mock Test Boxes with Names: Variables Python Programming · Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Variables and Data Types
Why is 12 = age an error? Are score and Score the same variable?
- Keep values in variables and change them step by step
- Follow a program by hand and tell four kinds of value apart
- Choose clear names and build a shop bill
5Lessons14Problems8Python Labs1Question Set1Mock Test