2 Computer Programming (Lecture 2)
2 Computer Programming (Lecture 2)
Waguih
Python
CHAPTER 2
Input,
Processing,
and Output
Designing a Program
Input, Processing, and Output
Displaying Output with print Function
Comments
Variables
Reading Input from the Keyboard
Performing Calculations
More About Data Output
1
04/04/1446 Dr. Hoda M. Waguih
Python
2
04/04/1446 Dr. Hoda M. Waguih
Python
3
04/04/1446 Dr. Hoda M. Waguih
Python
4
04/04/1446 Dr. Hoda M. Waguih
Python
Designing a Program
Input, Processing, and Output
Displaying Output with print Function
Comments
Variables
Reading Input from the Keyboard
Performing Calculations
More About Data Output
5
04/04/1446 Dr. Hoda M. Waguih
Python
◦ Produce output
Designing a Program
Input, Processing, and Output
Displaying Output with print Function
Comments
Variables
Reading Input from the Keyboard
Performing Calculations
More About Data Output
6
04/04/1446 Dr. Hoda M. Waguih
Python
Syntax
print (object(s), sep=separator, end=end, file=file, flush=flush)
Parameter Description
object(s) Any object, and as many as you like. Will be converted to string before
printed
sep='separator' Optional. Specify how to separate the objects, if there is more than one.
Default is ' '
end='end' Optional. Specify what to print at the end. Default is '\n' (line feed)
7
04/04/1446 Dr. Hoda M. Waguih
Python
8
04/04/1446 Dr. Hoda M. Waguih
Python
Designing a Program
Input, Processing, and Output
Displaying Output with print Function
Comments
Variables
Reading Input from the Keyboard
Performing Calculations
More About Data Output
9
04/04/1446 Dr. Hoda M. Waguih
Python
10
04/04/1446 Dr. Hoda M. Waguih
Python
Designing a Program
Input, Processing, and Output
Displaying Output with print Function
Comments
Variables
Reading Input from the Keyboard
Performing Calculations
More About Data Output
11
04/04/1446 Dr. Hoda M. Waguih
Python
12
04/04/1446 Dr. Hoda M. Waguih
Python
13
04/04/1446 Dr. Hoda M. Waguih
Python
14
04/04/1446 Dr. Hoda M. Waguih
Python
15
04/04/1446 Dr. Hoda M. Waguih
Python
16
04/04/1446 Dr. Hoda M. Waguih
Python
17
04/04/1446 Dr. Hoda M. Waguih
Python
Designing a Program
Input, Processing, and Output
Displaying Output with print Function
Comments
Variables
Reading Input from the Keyboard
Performing Calculations
More About Data Output
18