Tuesday, November 13, 2018

Python Basics

Python

Before beginning with Python, you guys must download it via: https://www.python.org/downloads/

After you have finished downloading Python, open the IDLE to begin coding in Python.

  
INPUTTING AND OUTPUTTING
Let's start with the beginning, getting inputs and outputs.

The basic input function is input().
You could put in a prompt/question to ask before getting input within the parenthesis.
For example, input("What's your name"). The user will see this question and know what input the computer is asking for.
The basic output function is print(). 
Within the parenthesis, you put what you want to be printed out to screen. 




Let's break down that example some more!

We used the term "input", "output" and "function" but what does that mean?
An "input" refers to anything you would type to the computer and an "output" is what the computer will display.
In the example the output would be "What's your name" and the input would be the name you typed.

Lastly, a "function" is code that someone has already written and ready to use. Functions are important because they save us a lot of time. Instead of having to write code so that we can have the computer show the words "What's your name" we do a function call - i.e. use a function by typing it's name. Throughout our examples we will provide the function names to use but it is always a good idea to look up more functions because they always provide something useful.

No comments:

Post a Comment

Introduction

Hello! Welcome to Coding for the Young Ones! This blog is to teach the basic principles of programming and Computer Science, specifically ...