stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Python Programming Review Flashcards | StudBud
Explore
/
Python Programming Review
Python Programming Review
18 terms
·
StudBud Administration
·
145 plays
An #Introduction to #Computer #Studies Grade 10 to practice #programming basic concepts.
Flashcards
18 cards
F
Practice quiz
P
Host live
L
Questions
18
Answers
1
What operator do we use to concatenate strings?
==
-
+
++
2
What is the greatest possible number that will be generated by random.randint(1,15)?
14
16
1
15
3
How do you convert the number “46” into a string?
string(‘46’)
str(46)
convert(46)(string)
46 = “46”
4
The basic variable types are:
literal characters
numbers
strings and numbers
strings
5
What arithmetic operators can be used with strings ?
%
- and *
**
+ and *
6
What is the meaning of sum = sum + 1 in Python?
The variable sum is incremented by 1.
The variable sum is renamed sum1.
The variable sum is deleted from the computer's memory.
The variable sum is not changing the value.
7
Which of the following means “not equal to”?
/=
!=
=!
-=
8
Identify the mistake in this python statement:
There’s no colon.
There should be an elif section.
The print function is spelled incorrectly.
There should be 2 equal signs.
9
If number % 2 == 0: What is the condition of this if statement?
number is odd
number is even
number is doubled
number has a 2 in it
10
Which code doesn’t work?
print “no this is wrong”
print “this is wrong”
print “this is right”
print “no this is the wrong one’
11
How many times does a while loop run?
For as long as the condition is met
Forever
Once, when the condition is not met
3 times
12
What is the symbol in python for greater than or equal to?
>==
+=
>=
==
13
What syntax gives you the remainder of a number divided by another number?
/
-
%
*
14
Which of the following is a float?
98
"3.4"
3.41
True
15
Which of the following is invalid?
_a=1
_str_=1
__a=1
none of the mentioned
16
What needs to be changed in this code?
Add a colon after 10
Add another indent on the bottom line
“while” is spelt wrong
Switch the “<” and “=” around
17
What is the output?
0 1 2 0
error
none of the mentioned
0 1 2
18
What do two equal signs next to each other mean?
It’s an indicator to show a space
It has no meaning and will crash your code
It means that two variables are equal
You assign a value to a variable