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