Flashcards
Sem título
Flashcards do conjunto (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—
Informações
- Descrição
- FlashCards sobre Sem título, criado por Abd-Ur-Rahmaan Shabbir em 08-11-2019.
- Criado por
- Abd-Ur-Rahmaan Shabbir · nov 2019
- Atualizado
- 11 nov 2019
- Visualizações
- 0
- Avaliação
Mais sobre Variables, Constants and Data Types