Paul Sutton

Personal Blog

New Python worksheets

I am now working on some new Python resources. I uploaded two of the resources mentioned in the previous post, and took some of the code from the TkInter resource (which is still available) and created a resource to look at testing if text from a user is what is being asked for.

As of 22/05/2023, I have :-

  • Python Arrays
  • Python String Length
  • Check User Input
  • Python3 Functions 2
  • Python3 Functions 1
  • Trinket Get Started
  • Python Nested Loops2
  • Python Nested Loops

These are designed to be used along side each other. As we are also using Trinket at Code Club.

My intention is to create more and use them as a Teaching Assistant or Tutor in a school or elsewhere. I am employed by an agency so if you want someone who can help teach computing in a primary school or have a group of children who want to move up then please get in touch. I can send my CV which will have my employer details on.

I can also help with Scratch, Micro:bit, electronics, Science etc

I will NOT be making these resources generally available.

These are already available

Tags

#CodeClub,#Python.#Programming,


Mastodon ShellLabs Join Mastodon
AI statement : Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity. Consent CANNOT be assumed, it has to be granted.

Donate using Liberapay

The Damage to Lunar Orbiting Spacecraft Caused by the Ejecta of Lunar Landers

This is an interesting paper looking at The Damage to Lunar Orbiting Spacecraft Caused by the Ejecta of Lunar Landers.. The Link was posted to the Fediverse.

Links

Just highlights the many dangers of space exploration, we need to protect any spacecraft from moon ejecta. How we do this will of course require more research and data, as I guess we can't just go up and collect a load of moon dust and bring to earth, probably not as simple as that as we would probably need to simulate the gravity difference on the moon.

I have started a discussion on science forums around this as I am just speculating about how we can research this. I would guess that once we do have data, then we can use AI to help with simulations.

Tags

#Moon,#SpaceFlight,#Missions.#MoonDust,#Electa,#SpaceCraft,#Damage


Mastodon ShellLabs Join Mastodon
AI statement : Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity. Consent CANNOT be assumed, it has to be granted.

Donate using Liberapay

Old python worksheets

A few years ago I created some worksheets to help teach nested loops. They are probably for Python2.x but can be adapted.

These are OLD and are therefore provided 'as is'. If you need help please send me a fediverse message on @zleap@qoto.org

Tags

#CodeClub,#Python.#Programming,


Mastodon ShellLabs Join Mastodon
AI statement : Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity. Consent CANNOT be assumed, it has to be granted.

Donate using Liberapay

Debian 12 release

Debian 12 (Bookworm) is scheduled for release on Saturday 10th June 2023.

We should be able to take a closer look at a future STEM group meeting.

Tags

#Computer,#OperatingSystem,#FreeSoftware,#Debian


Mastodon ShellLabs Join Mastodon
AI statement : Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity. Consent CANNOT be assumed, it has to be granted.

Donate using Liberapay

American football – Torbay Trojans vs Cornwall Home

Next game is Sunday 4th June 2023. We are playing Cornwall Monarchs at home, kick off 14:00 at Foxhole field, Bellfield Road, Paignton.

Pitch marking will take place on Saturday 3rd June 2023 From 9:30.

Links

Fixtures

23rd April Wyverns vs Trojans 2pm Kick off 30th April Trojans vs Storm 2pm Kick off 21 May Dreadnoughts vs Trojans 2pm Kick off 28th May Trojans vs Dreadnoughts 2pm Kick off 4th June Trojans vs Monarchs 2pm Kick off 16th July Trojans vs Wyverns 30th July Storm vs Trojans 6th August Monarchs vs Trojans

Tags

#Trojans,#Football,#Training,#TorbayTrojans, #AlwaysTrojan,#Fixture,#CornwallMonarchs


Mastodon ShellLabs Join Mastodon
AI statement : Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity. Consent CANNOT be assumed, it has to be granted.

Donate using Liberapay

Code Club – Python functions 2

So to follow the previous post, we are going to look at passing 2 arguments to a function, adding them together, then displaying the result.

Firstly open a new Python Trinket

Firstly we are going to tell the interpreter to use python3.

#!/usr/bin/env python3 #use python 3

Now we create a function to take two arguments and display the sub of both

def add_numbers(x,z):
  #print(x)
  #print(z)
  add = (int(x) + int(z))
  print ('Total = ')
  print(add)

Get user input

x = input("First Number") # ask for first number
z = input("Second Number") # ask for second number

Convert to integers

int(x)
int(z)

Call function and pass values to function

add_numbers(x,z)

Tags

#CodeClub,#Python.#Programming,#Functions,#Arguments


Mastodon ShellLabs Join Mastodon
AI statement : Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity. Consent CANNOT be assumed, it has to be granted.

Donate using Liberapay

Free Software Foundation workshop – 30th May 2023

BigCode: Open and responsible research on code-generating AI systems

BigCode: Open and responsible research on code-generating AI systems

Links

Tags

#FSF,#FreeSoftware,#Workshops


Mastodon ShellLabs Join Mastodon
AI statement : Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity. Consent CANNOT be assumed, it has to be granted.

Donate using Liberapay

Code Club – Simple Python 3 Functions

As we are learning Python at Code Club, I am going to make some related posts looking at the very basics of this. We are using Trinket.io for this

Firstly open a new Python Trinket

Firstly we are going to tell the interpreter to use python3.

#!/usr/bin/env python3 #use python 3

We are going to create a function called print_name() and then call it. The function will just print hello to the standard output.

def print_name():
  print ("hello")
  
print_name()  

So this in does the same as what

print ("hello")

To the next step is to run the function several times.

We could run

print_name()  
print_name() 
print_name() 

However it is probably better to put the print_name() in a loop, so it calls the function a specified number of times (in this case 4)

for x in range(0,4):
  print_name()

So this will now call the print_name() four times (or however many times is specified.

Assuming this works, we can now add some user interactivity

y = input("iterations")

As we are dealing with numbers (integers) than y will be a string we fix this in the line for x in range(0,int(y)): int(y) will convert string y in to integer y

Final program looks like this:-

def print_name(y):
  print ("hello")

y = input("iterations")
for x in range(0,int(y)):
  print_name(y)

Will ask for user input, store this in the variable y, as an integer. It run a loop which calls the function y times. Which in turn prints hello.

If you add the line

print(y)

After the

print("hello") 

Line, then the program should output a number count for each iteration. This can be a useful too for debugging loops. This will also make use of the fact we are passing the value of y to the function.

Links

Tags

#CodeClub,#Programming,#Education,#Python.#Functions


Mastodon ShellLabs Join Mastodon
AI statement : Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity. Consent CANNOT be assumed, it has to be granted.

Donate using Liberapay

Still using Twitter ? Why ?

This is interesting, codes are there to keep people safe, voluntary or otherwise.

This was mentioned on the Fediverse

Should make an interesting discussion.


Mastodon ShellLabs Join Mastodon
AI statement : Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity. Consent CANNOT be assumed, it has to be granted.

Donate using Liberapay

Fightback has started.

With the climate crises getting worse, floods, extreme weather, heat, storms all being linked to climate change and this in turn being linked to fossil fuels, the fight back has started.

Climate Earth have filed a case against the board of Shell as detailed below.

In February 2023, we filed a case against Shell’s Board of Directors for failing to move away from fossil fuels fast enough. This is the first ever case of its kind seeking to hold corporate directors personally liable.

In May 2023, the UK High Court dismissed the case, but has since granted us an oral hearing at which we will ask the Judge to reconsider.

You can read more here

We need action NOW, there is a lot of pessimism within the science community as to if we are actually going to reach our aims of reaching our target of avoiding a 1.5 degree global temperature rise See previous post here which links to an article in Nature.

Global temperatures are rising and this is the case even if you factor in events such as El-nino.

Hopefully the judge in will allow the court case to go ahead.


Mastodon ShellLabs Join Mastodon
AI statement : Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity. Consent CANNOT be assumed, it has to be granted.

Donate using Liberapay