First lines of code

We will go through the absolute basics before jumping into any kind of scary programs. The following commands might seem a bit simple or tedious, but you need to master these to build you own automated systems! We encourage you to type these commands in the Python interactive shell on Repl and try them yourself. By doing this, you will remember things in a much better form than by just reading them.

>>> 2+2        # -> Input and press Enter
4            # -> Output

>>> 3*5        # -> Input and press Enter
15            # -> Output

>>> 2/2        # -> Input and press Enter
1            # -> Output

Concluding this unit, lets write our first Python code:

>>> print('Hello, world!')
Hello, world!

This is often the very first program people write when they are new to a language.

A "Hello, World!" program is a computer program that outputs or displays "Hello, World!" to a user. Being a very simple program in most programming languages, it is often used to illustrate the basic syntax of a programming language for a working program. It is often the very first program people write when they are new to a language. - Wikipedia

Questions:

  1. What will this input if you enter it on the black box (Python interactive shell) in your REPL window: 14 + 25? a. 38 b. 39 c. 40 d. TypeError

  2. What will this input if you enter it on the black box (Python interactive shell) in your REPL window: print("Hello there, learner!") a. Hello there, learner! b. 'Hello there, learner!' c. "Hello there, learner!" d. Error

results matching ""

    No results matching ""