You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
2.6 KiB
32 lines
2.6 KiB
import { addBanner, addArticle, addTitle, addHeader, addParagraph, addClassParagraph, addSubHeader, addOrderedList, addUnorderedList, addBlockquote, addInset, addInsetList, addInsetCodeListing, addInsetBulletList, addImageWithCaption, addButtonGroup, addSidebar, addSyntax, menu, global_menu } from '/scripts/import.js'; |
|
import { local_menu } from '/scripts/programming.js'; |
|
|
|
const heading = document.querySelector(".heading"); |
|
const global = document.querySelector(".global_menu"); |
|
const local = document.querySelector(".local_menu"); |
|
const sidebar = document.querySelector(".sidebar"); |
|
const main = document.querySelector(".main_content"); |
|
|
|
heading.append(addTitle("Programming Fundamentals")); |
|
heading.append(addParagraph("Annyce Davis - LinkedIn Learning - April 2024")); |
|
heading.append(addParagraph("FUNDAMENTALS")); |
|
global.append(global_menu()); |
|
local.append(local_menu("programming_fundamentals")); |
|
|
|
main.append(addHeader("Useful Notes")); |
|
main.append(addSubHeader("VS Code")); |
|
main.append(addParagraph("In VS Code, you can run a python program by right clicking on the python file and selecting Run Python and then Run Python File in Terminal or Run Selection/Line in Python Terminal.")); |
|
main.append(addParagraph("Note that you also have to set up your python debugger and that seems to be quite a fiddly thing to do but if you open up the python extension (ie, click extensions and then select python, the extension page includes a video showing you how to do that).")); |
|
main.append(addSubHeader("Operators")); |
|
main.append(addParagraph("Operators are pretty much standard but just a note re division")); |
|
main.append(addSyntax("/ The division operator, will return a float if necessary, that is 5 / 2 would return 2.5.")); |
|
main.append(addSyntax("// The Floor division operator which is essentially the integer division operator so it will return an integer. So 5 // 2 would return 2.")); |
|
main.append(addSyntax("% This is more standard and is the modulo operator so it will return the remainder after performing integer division so 5 % 2 would return 1.")); |
|
main.append(addSubHeader("Conditionals")); |
|
main.append(addParagraph("Basic syntax for if with an else clause:")); |
|
main.append(addInsetCodeListing(["if condition:", " do work", "else:", " do something else"])); |
|
main.append(addHeader("Useful Links")); |
|
main.append(addParagraph("<a href='https://www.python.org/downloads/'>Download Python</a>")); |
|
main.append(addParagraph("Info on <a href='https://www.w3schools.com/python/gloss_python_arithmetic_operators.asp'>Python Arithmetic Operators</a> on www.3schools.com.")); |
|
|
|
addSidebar("programming"); |