JIT — Intro to Data Science · Python Lab · Problem 1 of 30

Hello, world

Your first Python programme. Put the lines in order, choose the right words, then run it.

What you are building

Write a programme that prints three lines of text on the screen, in this exact order:

Hello, world! My name is Kartik Vyas I am teaching data science

What Python needs from you

Python reads your file from the top line to the bottom line, one line at a time, and does exactly what each line says. Nothing more. If you want three lines of text, you write three instructions.

New word — statement One instruction on one line. A Python programme is a stack of statements, carried out from top to bottom.
New word — function A ready-made tool with a name. You use it by writing its name followed by round brackets: print(). Whatever you put inside the brackets is what the tool works on. print is spelt in small letters, always.
New word — string Plain text, wrapped in quote marks: "Hello, world!". The quotes tell Python "this is text to be used as it is, do not try to understand it". Both quotes must be the same kind, and both must be there.
New word — comment A line starting with #. Python ignores it completely. It is a message for the human reading the file, usually saying what the programme does.
Coming later Right now every piece of text is typed out in full. From problem 2 you will store text in a variable and reuse it, instead of repeating it.

Arrange the steps

Forget the Python for a moment. These are the four things the programme has to do, listed in a jumbled order. Click them in the order they should happen.

The note to the reader belongs at the top. After that, the three pieces of text must be printed in the same order as the output you were shown in stage 1.

Your plan

Empty. Click a step below to add it here.

Steps to choose from

Fill the statements

Your four steps, now written as Python, in the order you put them. Three words are missing. Choose what goes in each blank — and if you get one wrong, Python will tell you exactly what it did not understand when you run the programme.

Three blanks, three choices to make. Leave nothing on "choose…".

Run and read

This is your programme as it stands. Press run to see what Python does with it.

Output

Nothing has run yet.