Skip to content

Instantly share code, notes, and snippets.

@DominicFinn
Created April 28, 2025 13:31
Show Gist options
  • Save DominicFinn/9bdcb909ce73f4dbd00a93068c8bdb29 to your computer and use it in GitHub Desktop.
Save DominicFinn/9bdcb909ce73f4dbd00a93068c8bdb29 to your computer and use it in GitHub Desktop.
Tasks for Connor

Killing rats

So, when you first start learning how to code, it's a little bit boring. Essentially that's tough luck. Soz. You have to learn the basics first sadly.

BUT. Think of this as grinding. Grind to get the EXP to continue your journey. Learning to program is better than doing boring jobs so.... 🤷🏻‍♂️

After you've followed some of the basics, we can quit the tutorial and start the basic missions. Here's some tasks to see what you have learned. If you can't do them, it doesn't matter. Get to where you can first then try and Google the answers. Basically, trying to work out how the hell you do something is part of the fun.

Basic tasks

Q1

Add two numbers like 220 and 10 together and print the result.

Q2

Print the result of 200 * 4 + 12

Q3

Add the strings "I am" and "Conner McCloud and of the Clan McCloud" and "and I am immortal" together and make string that makes:

Q4

"I am Connor McCloud of the Clan Mcloud and I am immortal"

Q5

Print the mean average of 5, 10, 32, 4, 5, 23, 4, 4, 5, 2, 1, 5, 6, 7, 3, 4, 4, 5

Q6

Explain if you think the mean is the best way to explain the average of the above numbers?


Lists

Background, the list of numbers is:

[5, 10, 32, 4, 5, 23, 4, 4, 5, 2, 1, 5, 6, 7, 3, 4, 4, 5]

Q7

Given a list of numbers, print the highest number.

Q8

Given a list of numbers, print the lowest number.

Q9

Given a list of numbers, print the mean average.

Q10

Given a list of numbers, print the median number.

Q11

Given a list of numbers, print the mode number.

Q12

Given a list of numbers, print the range of the numbers.

Q13

Given a list of numbers, print the sum of the numbers.

Q14

For each value in the list, print the value squared.

Q15

For each value in the list, print the value cubed.

Q16

For each value in the list, if it's above the mean, print "above" otherwise print "below".

Q17

For each value in the list, print whether it's above or below the mean, median or mode.

Files

Q18

Create a file called "myfile.txt" and write the text "Hello, world!" to it.

Q19

Read the file "myfile.txt" and print the text to the console.

Q20

Create a CSV file with two columns that has values in it like this:

Name, Age Connor, 21 Dominic, 42 Joe, 54 Nikhil, 14 Rohan, 12 Erin, 13 Aoife, 11

Q21

Read the CSV file and print the values to the console.

Q22

Read the CSV file and print the oldest person only.

Q23

Read the CSV file and print the youngest person only.

Q24

Read the CSV file and print the name of the coolest person (which one has the most computers)

Q25

Read the CSV file and print the name of the person who has the least computers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment