Strings And Variables Flashcards

To Be Able To Define Important Words And To Be Able To Correctly Write Variable Names (5 cards)

1
Q

What is an Algorithm?

A

An Algorithm is a set of of instructions followed in sequence to perform a specific task.

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

What is a Variable?

A

A Variable is a named storage that can be assigned value.

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

What are some examples of when you might use a variable in a program?

A

Some examples of when you might use a variable in a program are when you want to:

Store your progress in a game.

Store the results of the users tests.

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

What are the four main naming conventions that should be followed in Python.

A

The four main naming conventions that should be followed in Python are that:

The name of a variable should not start with a number.

12name

The name of a variable should not start with a special character.

e.g. $name

The name of a variable should not have a space in between.

e.g. First name
However this variable name is allowed:
e.g. First_name

The name of a variable shouldn’t have reserved keywords

e.g. input

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

How can Comments be added to Python code?

A

Comments can be added to Python code using the # at the start of a line.

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