Knight Hop is a Junior 5 level 7 point problem. A little bit of chess knowledge is very useful, as it requires a knight. Functions are also extremely helpful, especially if it determines the possible next moves given a set of points. First, create a function than takes in a…
Python
CCC ’14 S3 – The Geneva Confection
https://dmoj.ca/problem/ccc14s3 The problem above is mainly based off logic. It really requires only a few if else statements, variables and loops. First, you need to create a loop that loops based of an integer input. Everything else will be in this loop. Create an empty list that is for the…
CCC ’14 S1/J4 – Party Invitation
https://dmoj.ca/problem/ccc14s1 This is a dmoj 5-point Junior 4 question. It is more complex than it seems. Read on to find the solution and the logic to it! First, read the question. Without knowing what the question is about, all the rest of this blog will be useless. First things first,…
What is Python?
Python is a popular programming language created by Guido van Rossum, and released in 1991. It is used for: software development mathematics What can Python do? Python can connect to database systems. It can also read and change files. Python can be used to handle big data and perform complex…
How to Install a Package on Pycharm
On the top left corner, click file-settings or do ctrl+alt+s. Go to Python Interpreter. Click the plus sign that is near the bottom. Search up the package you want to install, like numpy or matplotlib. Click Install Package Wait until it is installed, and then you are done!
Fastquant
Fastquant is a new python package that is related to stocks. Using only two lines, you can predict which stocks are good to buy, and which stocks you should sell. First, install the fastquant package. Then, type the following: Run the program, and on the top left you will find…
LED Bar Raspberry Pi Project
To make a flowing water light, you will need the following: 11 wires 1 bar graph LED 1 breadboard 10 220 ohm resistors 1 raspberry pi 3 Now, place the pieces like the following: Once you are done putting the pieces in the right place, type the following code: Once…
Emails using python: example code
If you get an error, it typically means that there is a security error. To solve this problem, do the following steps: Click the top right part of your Gmail page. Click “Manage Your Google Account”. Go to the “security” section. Scroll down to the part that say’s “Less secure…
Raspberry Pi Police Light
Making a police light from a Raspberry Pi isn’t easy! But it sure is cheap. You will need: 7 wires 1 raspberry pi 3 1 red LED 1 blue LED 2 220 ohm resistors 1 momentary push button 1 breadboard Now place the pieces like the following: Then, using python,…
Python print() (Pt. 2)
The “%s” sign Try this code: Did it print what you thought it would? This is like the substitution method in linear equations. For all the “%s” signs, at the end, after the “%” sign, Using what is after it, replaces the “%s” sign. Can I use multiple “%s” signs?…
