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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what is a constant?

A

names data store that contains a value
- does NOT change during execution of program
- has meaningful names

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How to make a conditional statement

A

if (variable) = (something):
print (“something”)
else:
print (“no”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly