8- Programming Flashcards
1
Q
What is a variable
A
named data store that contains a value
- could change during execution of program
- have meaningful names
2
Q
what is a constant?
A
names data store that contains a value
- does NOT change during execution of program
- has meaningful names
3
Q
Basic data types
A
Integer- pos or neg numbers (can be used with mathematical operations)
Real- pos or neg numbers with a fractional part (can be used with mathematical operations)
char- a single character
string- several characters in length
–> characters can be any printable symbol
boolean- only has two values
4
Q
How to make a conditional statement
A
if (variable) = (something):
print (“something”)
else:
print (“no”)