Basic Foundation Concepts - Project 3
In this program the basic python such as comments , varibles, Data Types, Booleans and operations are explained with examples.
The int() function converts the specified value into an integer number.
int(value, base) -syntex
Creating Variables : Variables are containers for storing data values.Unlike other programming languages, Python has no command for declaring a variable.A variable is created the moment you first assign a value to it.
String literals in python are surrounded by either single quotation marks, or double quotation marks.
‘hello’ is the same as “hello”.
You can display a string literal with the print() function:
print(‘in 2020, you will be’, 2020 -int3)
counter = 100
miles = 1000.0
name = “john”
Built-in Data Types In programming, data type is an important concept.Variables can store data of different types, and different types can do different things.Python has the following data types built-in by default, in these categories:
int, float, complex
list, tuple, range
bytes, bytearray, memoryview
Python Arithmetic Operators:
x + y
x – y
x * y
x / y
x % y
x ** y
x // y