stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Python Programming Flashcards | StudBud
Explore
/
Python Programming
Python Programming
27 terms
·
StudBud Administration
·
37 plays
An #Introduction to #Computer #Studies Grade 10 to practice #programming basic concepts.
Flashcards
27 cards
F
Practice quiz
P
Host live
L
Questions
27
Answers
1
What is the meaning of sum = sum + 1 in Python?
The variable sum is deleted from the computer's memory.
The variable sum is not changing the value.
The variable sum is incremented by 1.
The variable sum is renamed sum1.
2
Is Python case sensitive when dealing with identifiers (variable names)?
no
sometimes only
yes
none of the mentioned
3
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’
4
Which of the following is a float?
"3.4"
True
98
3.41
5
Identify the mistake in this python statement:
There should be an elif section.
There’s no colon.
There should be 2 equal signs.
The print function is spelled incorrectly.
6
What is the output?
1
15
0
3
7
Which of the following variables is a string?
1.567
[75,87]
75
“Hello World!”
8
What is the output from this code?
121
110
22
122
9
What is the output?
5.0
14.5
10.0
50.0
10
The basic variable types are:
strings
literal characters
numbers
strings and numbers
11
What is the output?
5 10 15
1 2 3 4 5
5 10
1 2 3 4 5 6 7 8 9 10 11 12 13 14
12
Python got its name from
a snake at a Zoo
the person's name who invented the programming language.
a children's book
a BBC comedy series, "MontyPython's Flying Circus".
13
To move up and down the screen to see all the info you use a:
Click Bar
Scroll Line
Scroll Bar
Ladder
14
How many times does a while loop run?
Once, when the condition is not met
Forever
For as long as the condition is met
3 times
15
What is the symbol in python for greater than or equal to?
==
>==
+=
>=
16
What is the output?
1 2 3
1 2 3 4
1 2
1 2 3 4 5
17
What syntax gives you the remainder of a number divided by another number?
%
*
/
-
18
What is the symbol in python for less than or equal to?
<=
<
-=
=<
19
What is the greatest possible number that will be generated by random.randint(1,15)?
15
14
1
16
20
What operator do we use to concatenate strings?
+
==
-
++
21
If number % 2 == 0: What is the condition of this if statement?
number is doubled
number has a 2 in it
number is even
number is odd
22
What do two equal signs next to each other mean?
It’s an indicator to show a space
It means that two variables are equal
You assign a value to a variable
It has no meaning and will crash your code
23
What is the output?
48
42
46
44
24
Which of the following means “not equal to”?
!=
-=
=!
/=
25
What needs to be changed in this code?
Add a colon after 10
“while” is spelt wrong
Switch the “<” and “=” around
Add another indent on the bottom line
26
Which function do you use to ask the user to enter a number?
raw_input()
print
import a number
input()
27
What output does this statement produce?
++++
-----
*****
+++++