Flashcards
Untitled
Cards in this deck (6)
- 1What is a variable?A variable is a memory location which is used to store a value of any data type, which can be changed at any point while the program is running.
(E.G. name = Akeel) - 2What is a constant?A constant is a memory location which is used to store a value of any data type, usually indicated by the name of the constant being in full capitals, and the value cannot be changed.
(E.G. NAME = Akeel) - 3What is the difference between a variable and a constant?A variable can be changed while the program is running, however a constant cannot.
Also constants do not actually exist in python - 4State all 5 data types and define themString = A sequence of characters which can include letters, spaces and other characters
Integer = A whole number only, no decimal places
Floating point = A number with a fractional part, also known as real
Boolean = Can only have one of 2 values, True or False
Character = A single letter, number or symbol - 5Explain how casting worksCasting, is an operation which is used to change or convert a variable's data type from one to another.
For example, int(Variable) would change the variable from a string to an integer - 6—
Information
- Description
- Flashcards on Untitled, created by Abd-Ur-Rahmaan Shabbir on 08/11/2019.
- Created by
- Abd-Ur-Rahmaan Shabbir · Nov 2019
- Updated
- Nov 11, 2019
- Views
- 0
- Rating
More on Variables, Constants and Data Types