Skip to main content

Posts

Showing posts from August 13, 2019

Python Input Output

Python Input Output We use the print() function to output data to the standard output device (screen). Up till now, our programs were static. The value of variables were defined or hard coded into the source code. To allow flexibility we might want to take the input from the user. In Python, we have the input() function to allow this. The syntax for input() is s = input("Enter value: ") print (s )

Python Arithmetic

Python Arithmetic Expression syntax is straightforward: the operators +, -, * and / work just like in most other languages print ( 2 + 2) print ( 50 - 5 * 6) print ( ( 50 - 5 * 6 ) / 4) print ( 8 / 5)