0% found this document useful (0 votes)
0 views

Type these calculations into python IDLE

Uploaded by

abdurraheem1442
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Type these calculations into python IDLE

Uploaded by

abdurraheem1442
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Python: This is a programming language invented in

the 1980s. It is used by Yahoo, Shopzilla, (shopping


site), Battlefield 2, Civilization 4. Python is also used by
Nokia, Facebook etc.

Types of Pythons
1. The Interactive mode: This gives
immediate feedback to every line of code
entered. It is useful for testing, do as more
snippets of code.
2. Script Mode: This allows a programmer to
type in many lines of python codes and save
the code as a single program with a file
name.
Type these calculations into python IDLE (Interactive
mode window) and write down the answers that python
returns.
a. >>>print (7*9) =63
b. >>>print (63.74-21.16) = 64.58
c. >>>print (87/6) =14.5
d. >>>print (12*0.0) =0.0
e. >>>print (7+4*8) =39
f. >>>print (10//3) =3
g. >>>print (5**2) =25
h. >>>print (15%2) =1
i. >>>print (14%2) =0
j. What do the letters BIDMAS stand for? = Bracket
Indices Division Multiplication Addition and
Subtraction.
Type in this python program carefully and test it.
Can you change the story or make your own?
Name = Input (Your name)
Age = Input (Your age)
Cat = Input (favorite name of cat)
Wish = Input (What superpower you wish for)
Random = Input (Random word, the weirder the
better)

When we store information, (data) in python


program, we need to know the data type of the
information
Python Has Four (4) Data Types
1. String (Text or Alpha numeric information): Any
number that is enclosed with quote. e.g. “y”
2. Integers (A whole number, a number which is
not a fraction) e.g. 55 etc.
3. Floats (A number which can be a fraction) e.g.
5.6, 2.9 etc.
4. Boolean (True or False statement)

You might also like