Learn Python Online: Code in StuCent's Browser
Can a young learner learn Python online without installing anything? In StuCent, yes: Python code runs in the browser. StuCent coding activities also offer turtle drawing, block coding and a way for the computer to mark the code.
This post is for teens and for parents who want to know what a StuCent coding activity looks like.
Which languages can I code in?
StuCent coding activities use six languages:
- Python
- JavaScript
- Java
- C++
- C
- C#
Python and JavaScript run in the browser. Java, C++, C and C# run on StuCent's servers. You do not need to set that up yourself.
What kinds of coding activity are there?
A coding activity can be plain code that reads text and prints text. It can also be one of the visual modes. Each mode works with certain languages.
| Mode | What you do | Languages |
|---|---|---|
| Standard | Read input, print an answer | All six |
| Turtle | Draw with a pen that moves on the screen | Python or JavaScript |
| Blocks | Snap code blocks together | Python or JavaScript |
| Turtle with blocks | Draw by snapping turtle blocks together | Python or JavaScript |
| Canvas | Draw on a 600x400 canvas | JavaScript |
| Game | Build a small game | JavaScript |
| Web | Write the HTML, CSS and JavaScript of a page | JavaScript |
Blocks suit younger learners. For them, an activity can start with some blocks already placed, and the learner adds the rest.
What does a turtle activity look like?
In a Python turtle activity, you control a small pen called a turtle. You tell it to move and turn, and it draws a line as it goes.
Here is a square:
from turtle import *
tom = Turtle()
for _ in range(4):
tom.forward(100)
tom.right(90)
The loop repeats four times: go forward 100, turn right 90 degrees. Four sides, four corners, one square.
Ask: what do you think happens if the loop runs 5 times, and the turn is 72 degrees?
That makes a pentagon. Change a number, run it, and look at the picture. That quick loop of trying and seeing is the fun part of turtle.
How does StuCent mark my code?
The way of marking depends on the mode.
Standard activities are usually marked by tests. Each test gives your program some input and checks the output it prints. An activity can show some tests as examples and keep others hidden, so you cannot just print the answers you were shown. By default, an activity gives part marks by the points of each test you pass. An activity can instead ask for every test to pass.
A standard activity can also use a different route. It can have an AI judge the code itself, ask for both tests and the AI check to pass, or send the work to a person for review.
Turtle, canvas, game and web activities have no tests with expected output. StuCent's server runs your code and checks simple things instead:
- A turtle activity: the code runs and draws something with the pen down.
- A canvas activity: something shows on the canvas.
- A game: something shows on the canvas after the game starts and runs for 30 frames.
- A web activity: the HTML, CSS and JavaScript tabs are not empty, and the JavaScript runs to its end without an error. If the model answer has no CSS, the CSS is not checked.
Handing back the starter code unchanged scores 0, unless the starter is also the model answer. Code that draws or shows nothing also scores 0.
These checks mainly show that your code runs and shows something. When the look of the work, or another personal choice, must be judged, an activity can use a person to review it with a rubric.
Block activities are run again on the server. Depending on the activity, the result is checked against the output of tests, compared with a model answer, or only checked to see that blocks are placed and print or draw something.
For JavaScript turtle blocks, the moves must match the model answer in order: forward 50 twice is not the same as forward 100. So the instructions name every number and colour you need. For Python turtle blocks, the server compares the two drawings, and they must be 90% alike. The colours must match too, unless the activity ignores colour.
Some activities also give hints. A hint can carry a point penalty.
Why not just install Python myself?
You can, and many people do. The browser way means a learner can begin without installing Python. For Python and JavaScript, the code runs right there in the page.
Try it
To see how a StuCent room works, open the first room of the English city, "Verb be with I and you".
Open the first room, Verb be with I and you
To see how rooms, houses and cities fit together, read the StuCent world map. Ready to start? Create a family account.
FAQ
Do I need to install Python?
No. In StuCent, Python code runs in the browser.
Can I use blocks instead of typing code?
Yes. Block activities use Python or JavaScript behind the blocks. A turtle version lets you draw with blocks too.
Is turtle only for Python?
No. Turtle works with Python or JavaScript. Canvas, game and web activities use JavaScript.
Which language should a beginner pick?
StuCent does not say. Python turtle, or turtle blocks, gives you a picture to look at after each run.