Homework 3 is due Monday 17th Sept.
Category: National 5
N5 – Homework for Friday
This was given out in class today. Use the following links for help when completing the task
- https://www.programiz.com/python-programming/operators (No need to read sections from Bitwise operators onwards)
- https://www.bbc.com/bitesize/guides/z8dbtv4/revision/5
- https://www.bbc.com/bitesize/guides/z8dbtv4/revision/6
N5 Homework
Complete Python Ex 2 for Monday
Higher – Input Validation (Revision)
We use the standard algorithm input validation to check that the user is entering a value that is expected by the program. In the example below our function is used to check that the entered integer is between a max and min value.
def getValidInt(fMin,fMax): print("Please enter a number between",str(fMin), "and",str(fMax)) number=int(input()) while number<fMin or number>fMax: print("Sorry try again") print("Please enter a number between",str(fMin), "and",str(fMax)) number=int(input()) return number def main(): min=-100 max=100 number1=getValidInt(min,max) number2=getValidInt(1,20) print(number1,number2) main()
The function follows the AREA standard algorithm, that is Ask Repeat Error Ask. so
- Ask for valid number
- Repeat While number not valid
- Display Error
- Ask for valid number
Too remember this mnemonic easier think Jonathan Ross for step 2, as in Python we would use a While.
The code above makes use of local variables as well as formal and actual parameters. Can you spot them?
Site Changes
I have now updated the course pages and categories to better organise the content of the site. This may mean that when you search for content that you need to check the categories to make sure it is up to date.
Good Luck – Higher and National 5
Good luck on the 22nd folks. Higher, please check your email for last minute notes.
N5 – Creating a Website Wireframe in draw.io
While you watch this video pay attention to the pixel sizes that are displaying inside draw.io, you can use this to plan a responsive web design.
N5 – BBC Bitesize
BBC’s Bitesize has now been updated with new National 5 Content.
N5 – Answers to HW
This weeks homework was question 14 from the 2017 past paper.
World Wide Web
Today in class we made use of Mozilla X-Ray Googles and Mozilla Thimble to edit existing web sites.
We also used the built-in Inspect tool to edit websites on the fly. The changes to the websites are on the local HTML files not on the server.
We noticed a lot of websites make use of the <div> tag, we will be investigating this next time.