DataTypes in Python
- str (T) -> str returns string showing literal (possible signed for numeric types)
- int (T) -> int returns 0 for False, 1 for True; truncated float; truncated real–part of complex
- float (T) -> float returns 0.0 for False, 1.0 for True; equivalent for int; real–part for complex
- complex (T) -> complex returns (0+0j) for False, (1+0j) for True; equivalent int and float
- bool (T) -> bool False for empty string and zero value, True for non–empty string and non–zero value
Examples of operators
a%b = a - b*(a//b)
bool('False') =True
12//5 is same as math.floor(12/5)
math.floor(-1.5)=??
int(-1.5)=??
print('Hitesh','Vataliya')=??
print('Hitesh'+'Vataliya')=??
print(5*'Hitesh')
Comments
Post a Comment