Python Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is a decimal place known as in python?

A

A float number

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

What is a concatenation?

A

A concatenation is something that joins the text and the code

Eg. print(“35=“),35)
The “ , “ was the concatenation
Another concatenation is a “ + “

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

Variables in numbers:

What do you have to put before an input if it is a number?

A

You have to clarify that it is an integer,
Eg. number=int(input(“enter a number”))

Tip: make sure there is two brackets at the end whilst using an “int”

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

What is the python symbol for less than?

A

<

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

What is the python symbol for greater than?

A

>

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

What is the python symbol for less than or equal?

A

<=

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

What is the python symbol for greater than or equal?

A

> =

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

What is the python symbol for equals?

A

==

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

What is the python symbol for not equal?

A

!=

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
If’s and else’s:
What is wrong with this?
if num==10
           print (“correct”)
else
           print(“wrong”)
A

There is no “ : “ at the end of the if and else so there would be a syntax error.

Eg. if num==10”:”
else”:”

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

What is an iteration?

A

A loop

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

What is a for loop?

A

Repeats an instruction a set number of times

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

What is a while loop?

A

Repeats until condition is met

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

How do you finish a loop?

A

You use a break

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

How to you start a pseudo code?

A

START

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

How do you show something is important in the pseudo code?

A

Put it in capital letters

17
Q

Do you need to show the brackets for the print function in pseudo code?

A

No

Eg. PRINT ‘player ones turn’