Higher – SDD – Reading a file into an array

The code below allows us to read a file into an array then process the data. In this case the processing is just to see how many of each of the numbers (1-6) there were in the file. The text file is the result of 1000 D6 rolls. Can you modify the program to work …

National 5 – SDD Predefined Functions

So today we were looking over predefined function. For the N5 course we have to be aware of RANDOM, ROUND, & LENGTH. The RANDOM function picks an integer between two values. import random number=random.randint(1,20) # random(StartValue,EndValue) print(number) The ROUND function rounds a real number (floating point) to a fixed number of decimal points. a=1.2 # 1 …

Higher – DIV CSS recap lesson

Using the supplied flag sheet create a HTML document to display each flag. Flags should be created using <DIV>, use CSS to style, you can choose to use inline, internal, or external CSS. Make use of float, background-color, borders, etc. as you see fit. I would say each flag should be about 300px long and …

N5 – CSS locations

There are three places that CSS data can be stored for use with HTML files. Inline Inline CSS applies to one html element it is added as the value for a style attribute. <h1 style=’color:red;’>Page heading</h1> Internal Internal CSS is declared inside <style> which is located in the <head> area of the page. It applies …

N5 – CSS Selectors

CSS is used to change the look of the website but not the HTML content of the website. At National 5 there are 3 CSS selectors. These are used to identify which parts of the web page are styled by CSS instructions. Element selector – This is used to select all html elements of the …