Python Numbers
Types
Python Numbers
Number data types store numeric values. Number objects are created when you assign a value to them. For example -
var1 =1 var2 =10
Python supports four different numerical types -
int (signed integers)
long (long integers, they can also be represented in octal and hexadecimal)
float (floating point real values)
complex (complex numbers)
STRING OPERATION:
The+ operator works with strings, but it is not addition in the mathematical sense.Instead it performs concatenation , which means joining the strings by linking them end-to-end. For example: >>>first = 10 >>>second = 15 >>>printfirst+second 25 >>>first ='100' >>>second ='150' >>>print first + second 100150
BOOLEAN EXPRESSIONS:
Aboolean expression is an expression that is either true or false. The following examples use the operator
== , which compares two operands and produces True if they are equal and Falseotherwise: True and Falseare special values that belong to the type bool ; they are not strings: >>>type(True) >>>type(False)
x != y # x is not equal to y x > y # x is greater than y x < y # x is less than y x >= y # x is greater than or equal to y x
If the value of left operand is greater than the value of
(a > b)
right operand, then condition becomes true.
is not
true.
<
If the value of left operand is less than the value of right (a < b)
operand, then condition becomes true.
is true.
>=
If the value of left operand is greater than or equal to the (a >= b)
value of right operand, then condition becomes true.
is not
true.
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- 13a05806 python programming
- built in functions
- ¾ introduction to c language ¾ university of pennsylvania
- python basic operators rxjs ggplot2 python data
- intro to verilog mit
- python basic operators picone press
- introduction to computing and problem solving with python
- numpy rxjs ggplot2 python data persistence caffe2
- an introduction to the c programming language and software
- python numbers
Related searches
- khan academy numbers and operations
- contact numbers for payday loans
- phone numbers for loans
- tea numbers for texas schools
- free preschool printable numbers works
- excel difference between two numbers formula
- phone numbers to loan lenders
- wyoming phone numbers and addresses
- percentage change between two numbers calculator
- 2 numbers in take 5
- python count numbers in a list
- python format numbers comma