Paul Sutton

trinket

More Trinket Coding

Trinket is a web based development platform. One of it's features is the programming language blocks, which is in fact a block based front end and creates Python programs.

I am sharing these on my blog today, even though I also shared earlier in the week on LinkedIn and also on Twitteras part of the Paignton Library Virtual Code Club.

Drawing a circle

circle1

And the associated output

circle1

Drawing a star

star1

And the associated output

star2

I am working on a book to update my previous Nested loops guide I wrote a few years ago. This needed updating anyway so it would cover Scratch 3.0. This book / guide is work in progress, and will be typeset in $\LaTeX$ using Overleaf

#programming, #trinket, #Blocks, #python, #WebIDE, #LaTeX, #Overleaf, #nestedloops, #loops, #codeclub

cc-by logo

Licenced under Attribution 4.0 International (CC BY 4.0)

At Paignton virtual Code Club, we are now approaching the end of the Scratch modules. Well done to everyone. The next step is probably to progress to Python [2][3].

If you don't feel ready to do lots of typing, you may want to look at Trinket and blocks. Then perhaps move to the Code Club modules [3].

Blocks, as the name suggests, is a block based system. The difference here is, that the blocks are all Python statements and code. So combining these allow you to easily start coding in Python.

To get started you need to sign up for an account on the Trinket website [1]

trinket

Click you user name and select new trinket and then select blocks

select blocks

You are now presented with your development area.

dev area

You may want to change your project title to something meaningful.

change title

You can select the category of block, then simply use click / drag in similar way as you would with Scratch.

So in this example I am just going to draw a square.

draw square

As we are using turtle, you will need to change the pen up, block so that it says pen down.

change command

Adding comments to your code is important, as it helps you keep track of what the code is doing and helps with debugging also helps others understand your code.

add comment

You can also view the Python code that is produced, this can be copy / pasted to IDE so you can just run the Python code on its own.

![View Python]

https://raw.githubusercontent.com/zleap/blogmedia/master/trinket/square-python-code.png

Finally you can share your project with others.

share

Hopefully this is helpful.

Resources

1 Trinket 2 Python 3 Code Club python Modules

#codeclub,#paignton,#trinket,#python,#coding,#skills,#technology

cc-by logo

Licenced under Attribution 4.0 International (CC BY 4.0)