filmov
tv
#2 Python Playground: IDLE and Operators | Computer Programming & Coding for Kids & Beginners

Показать описание
Lesson 2
Python Programming for Kids and Beginners: Getting Started with IDLE
Liam
Getting Started with IDLE
In order to run Python, you need an application.
Let's use the "IDLE" that was installed when Python was installed.
So let's get started!
Emma
Yay! I'm looking forward to it.
Liam
So first, let's launch IDLE.
Emma
What is IDLE?
Liam
An IDLE is an application that runs Python.
The name for IDLE comes from Eric Idle, an actor in Monty Python.
Emma
He really likes the comedy show.
Liam
Once you've installed Python, launch IDLE.
IDLE is an application for running Python in an easy way.
Since IDLE is a quick and easy way to try out, it's a good way to see how Python works and for beginners to learn.
When IDLE is launched, a shell window will appear.
Liam
Let's display the number with Python!
There are many things on the screen, but the last symbol that appears is called a prompt.
This means IDLE is saying, "Come on, give me anything!”
First, let's display the numbers.
To display 1, type print after the prompt and type 1 in parentheses.
Then press the Enter key and 1 is displayed.
Emma
Great! This is my first time programming.
Liam
Don't forget to type the parentheses.
The parentheses are necessary for the command.
If you get an error, calm down and try again.
Emma
Certainly!
Liam
Let's do the math with Python!
First, let's do a simple addition!
Type “print” after the prompt and type “1+1” in parentheses.
The next time you press the Enter key, the result of the calculation, 2, is displayed.
Emma
Great! Python can also calculate.
Liam
Thus, in IDLE, when you enter a command after the prompt, it is executed immediately.
The IDLE waits for the command until the Enter key is pressed, but as soon as the Enter key is pressed, it executes the command.
Liam
In addition to addition, you can also subtract, multiply, and divide.
The symbols used at this time are called operators.
The types of operators are shown in the table.
Emma
Great! Python can do various calculations using these operators.
Liam
Now let's do the subtraction.
Let's calculate 7-2.
Type “print” after the prompt and type “7-2” in parentheses.
The next time you press the Enter key, the result of the calculation, 5, is displayed.
Emma
OK! I was able to subtract too.
Liam
Next, let's try multiplication.
Let's calculate 3×2.
Type “print” after the prompt and type “6 asterisk 2” in parentheses.
The asterisk is the operator for multiplication.
The next time you press the Enter key, the result of the calculation, 6, is displayed.
Emma
OK! I was able to multiply it, too.
Liam
Finally, let's try division.
Let's calculate 6 divided by 2.
Type “print” after the prompt and type “6 slash 2” in parentheses.
The slash is the operator for division.
The next time you press the Enter key, the result of the calculation, 3, is displayed.
Emma
Now I can use Python on IDLE to display and calculate numbers.
Thanks! Liam.
Liam
Good job! Emma.
Python Programming for Kids and Beginners: Getting Started with IDLE
Liam
Getting Started with IDLE
In order to run Python, you need an application.
Let's use the "IDLE" that was installed when Python was installed.
So let's get started!
Emma
Yay! I'm looking forward to it.
Liam
So first, let's launch IDLE.
Emma
What is IDLE?
Liam
An IDLE is an application that runs Python.
The name for IDLE comes from Eric Idle, an actor in Monty Python.
Emma
He really likes the comedy show.
Liam
Once you've installed Python, launch IDLE.
IDLE is an application for running Python in an easy way.
Since IDLE is a quick and easy way to try out, it's a good way to see how Python works and for beginners to learn.
When IDLE is launched, a shell window will appear.
Liam
Let's display the number with Python!
There are many things on the screen, but the last symbol that appears is called a prompt.
This means IDLE is saying, "Come on, give me anything!”
First, let's display the numbers.
To display 1, type print after the prompt and type 1 in parentheses.
Then press the Enter key and 1 is displayed.
Emma
Great! This is my first time programming.
Liam
Don't forget to type the parentheses.
The parentheses are necessary for the command.
If you get an error, calm down and try again.
Emma
Certainly!
Liam
Let's do the math with Python!
First, let's do a simple addition!
Type “print” after the prompt and type “1+1” in parentheses.
The next time you press the Enter key, the result of the calculation, 2, is displayed.
Emma
Great! Python can also calculate.
Liam
Thus, in IDLE, when you enter a command after the prompt, it is executed immediately.
The IDLE waits for the command until the Enter key is pressed, but as soon as the Enter key is pressed, it executes the command.
Liam
In addition to addition, you can also subtract, multiply, and divide.
The symbols used at this time are called operators.
The types of operators are shown in the table.
Emma
Great! Python can do various calculations using these operators.
Liam
Now let's do the subtraction.
Let's calculate 7-2.
Type “print” after the prompt and type “7-2” in parentheses.
The next time you press the Enter key, the result of the calculation, 5, is displayed.
Emma
OK! I was able to subtract too.
Liam
Next, let's try multiplication.
Let's calculate 3×2.
Type “print” after the prompt and type “6 asterisk 2” in parentheses.
The asterisk is the operator for multiplication.
The next time you press the Enter key, the result of the calculation, 6, is displayed.
Emma
OK! I was able to multiply it, too.
Liam
Finally, let's try division.
Let's calculate 6 divided by 2.
Type “print” after the prompt and type “6 slash 2” in parentheses.
The slash is the operator for division.
The next time you press the Enter key, the result of the calculation, 3, is displayed.
Emma
Now I can use Python on IDLE to display and calculate numbers.
Thanks! Liam.
Liam
Good job! Emma.
Комментарии