|Learn Python with HackInScience|
|Written by Nikos Vaggalis|
|Friday, 02 July 2021|
HackInScience is a code challenge site that is mostly oriented towards learning than competing with others for a top ranking despite the presence of a Leaderboard. It's a playground of fun Python exercises, each with a user-friendly correction bot.
In order to showcase this, let's look at a simple exercise,"Characters counting" which requires writing code to "Print the number of characters in the given paragraph".
The screen is split into the vertical sections. The left side contains the description of what we ought to do in order to solve the challenge, as well as helpful advice, that is pointers to the things you should employ:
If you feel lost, you should start by reading the string tutorial.
and a little tutorial on "How do functions work"
How do functions work
A function is a named thing, that take a value (or multiple ones), do something with it, and often give back another value.
A basic example would be the max function that take multiple values and give back the biggest one, the syntax is:
max(1, 5, 2)
As such it prepares you to go and type the code in the center section of the screen,the Text editor, which is a in browser playground which compiles your code and gives you immediate feedback
File "./snippet.py", line 7
However the help when something goes wrong does not just confine itself in mere syntax errors, but through the use of friendly you get more context sensitive advice.For example in the for novices exercise Print 42, this is the message you get if you forget the parentheses:
However, the amount of the help and advice that is being offered varies from exercise to exercise. That said,the exercises are grouped into 5 logically divided sections of increasing difficulty:
1.Python — Basics
2.Python — Training
3.Python — Algorithms
4.Python — Command line
5.Python and Numpy
For instance you'll find exercises like:
and so on.
The site is totally free and doesn't even require an email to create an account or for using it. However when you sign up you can then check other's peoples' solutions as well as participate in the ranking.
Check it out at https://www.hackinscience.org/
or email your comment to: firstname.lastname@example.org
|Last Updated ( Friday, 02 July 2021 )|