learnpython24-(Data types and Type casting)
Data Types in Python Primarily there are following data types in Python. Integers (<class 'int'>): Used to store integers Floating point numbers (<class 'float'>): Used to store decimal or floating-point numbers Strings (<class 'str'>): Used to store strings Booleans (<class 'bool'>): Used to store True/False type values None: None is a literal to describe 'Nothing' in Python Rules for defining a variable in Python: A variable name can contain alphabets, digits, and underscores (_). For E.g. : demo_xyz = ‘It’s a string variable’ A variable name can only start with an alphabet and underscore. It can't start with a digit. 5aman is illegal and not allowed No white-space is allowed to be used inside a variable name. Also, reserved keywords are not recommended to be used as variable names. Examples of few valid variable names are aman , _demo , de_mo , etc. Python is a fantastic language that automatically identifie...
Comments