Star Student Builder logoStar Student BuilderA Learnerโ€™s Guide
โ† Systems, Data and the Way Out Std 9โ€“12Project 4 of 4

The Same Program in Text

๐ŸŽฏ Take a project you have already built and write it again in Python โ€” and see that you already know how to program.

๐Ÿ’ก The idea behind it

Blocks were never the point. Everything you learnt โ€” loops, conditions, variables, functions, lists โ€” is exactly what text languages have, with different punctuation.

๐Ÿงฑ Blocks you will need

define (My Blocks) โ†’ defrepeat โ†’ forforever โ†’ while Trueif/else โ†’ if/elsevariable โ†’ variablelist โ†’ list

๐Ÿ”จ Build it

  1. Take the quiz project from Std 6โ€“8. Write its questions and answers as two Python lists.
  2. 'repeat (length of questions)' becomes 'for i in range(len(questions)):'.
  3. 'ask and wait' plus 'answer' becomes 'reply = input(questions[i])'.
  4. 'if answer = item i of answers' becomes 'if reply == answers[i]:'. Note the double equals โ€” the one thing blocks protected you from.
  5. Run it. The same program, the same logic, twenty lines of text. You did not learn a toy; you learnt programming.

๐Ÿš€ Make it harder

  • Rewrite the high-score insert in Python and then replace it with sorted().
  • Move to Star Blocks in Code Master, or to a Python tutorial โ€” you are ready for either.

๐Ÿž Bugs you will hit

  • '=' assigns and '==' compares. This single confusion accounts for most first-week Python errors.
  • Indentation is not decoration in Python โ€” it is the syntax. What a block's C-shape showed you, spaces now show the computer.

โฌ‡ Need Scratch itself?

Free from MIT, in a browser or as an offline app that needs no connection at all.

Get it โ†’
Ask GuruAcharya Samayeshwar