datatypes of python
Day 13 – Datatypes, Statements and Expressions: Classes: Primitive, Assignment, ChangeToAmount Topic – Datatypes Each variable must be declared with a statement of the form: TYPE VARIABLE-NAME; where the type (or datatype) is the kind of information that can be stored in the variable. There are two categories of datatypes: Classes and Primitive. If the type is a Class, then the variable is an object of that class and will contain a reference to the area of memory in which all of the attributes are stored. If the type is a primitive type, then the variable is a primitive value and will contain the actual data. Primitive types: boolean – can store only the value true or the value false char – can store any single character … not like String … only one character double – can store a number, with a fractional component int – can store a number, without a fractional component
Document information
- Uploaded on
- October 28, 2023
- Number of pages
- 10
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers