Computing: Python Flashcards

1
Q

What is syntax?

A

Syntax, in a nutshell, is the grammar of computers.

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

Name one program you can use python on.

A

iDLe

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

What is the difference between strings and integers.

A

Strings are small pieces of text while integers are numbers.

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

Which of the following does not retain a condition to run the code?

a) If
b) else if -elif-
c) else.

A

C

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

What is created once an ‘If’ statement is implemented into code?

A

A branch

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

What does != mean as an operator in code?

A

Not equal to.

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

What does < mean in code?

A

Less than

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

What does > mean in code?

A

Greater than.

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

What does == mean?

A

Equal to.

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

Name the two data types.

A

Integers
Strings

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

What does the hash symbol indicate a line of text is?

A

A comment; something that the program ignores entirely and is purely there so others can understand the code.

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

What does ** mean?

A

To the power of.

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

What does % mean?

A

It indicates to the program to give a remainder of a division.

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

How do you show the output of the addition of two numbers?

A

print(“Sum of two numbers: “,num1+num2”)

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

How do you show the output of the addition of two numbers?

A

print(“Sum of two numbers: “,num1+num2”)

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