MCQExams
0:0:1
CBSE
JEE
NTSE
NEET
Practice
Homework
×
Computer Science
Python Coding
In python the ' STRING data type' can be defined as...?
Report Question
0%
holds alphanumeric text
0%
hold whole numbers
0%
holds numbers with a decimal point
0%
holds either a true or false value
In python the ' INTEGER data type' can be defined as...?
Report Question
0%
holds alphanumeric data as text
0%
holds whole numbers
0%
holds numbers with a decimal point
0%
holds either ‘true’ or ‘false’
In python the ' FLOAT data type' can be defined as...?
Report Question
0%
holds alphanumerical data
0%
holds whole numbers
0%
holds a decimal point in a number
0%
hold either true or false
In python the ' BOOLEAN data type' can be defined as...?
Report Question
0%
holds alphanumerical data
0%
holds whole numbers
0%
holds a number with a decimal point
0%
holds either true or false
What is the correct definition for a VARIABLE?
Report Question
0%
a changeable value, such as a score in a computer game.
0%
a value that cannot be changed
What data type would be used for storing someone's telephone numbers?
Report Question
0%
Float (using a decimal point)
0%
Integer (just whole numbers)
0%
String (alphanumerical data)
If we needed to store information such as a POSTCODE in PYTHON, what data type would we use?
Report Question
0%
String (alphanumerical)
0%
Float (decimal point)
0%
Boolean (true or false)
What is the correct definition for 'pseudo code?'
Report Question
0%
a notation resembling a complex programming language, used in program design.
0%
a notation resembling a simplified programming language, used in program design.
What is the function of the code:amount = int(input("Enter a conversion into pounds:))currency = input ("press 1 for indian rupees, 2 for Chinese yuan or 0 to exit:")
Report Question
0%
to find the total amount of currency altogether
0%
to calculate and convert the exchange rates.
what is the code for a STRING in python?
Report Question
0%
str
0%
stri
0%
stg
what is correct code for INTEGER in python?
Report Question
0%
in
0%
ing
0%
int
What is the output from the following code?print ("hello world")
Report Question
0%
Hello World
0%
hello world
0%
print hello world
What best defines an IF statement in python?
Report Question
0%
Is an embedded string with a variable
0%
An IF statement checks to see if a statement is true or false and then does one of two things depending on the result.
I am 71 years old! What will the output be?: IF you are 70 or older, say “You are aged to perfection!” ELIF you are exactly 50, say “Wow, you are half a century old!” ELSE say “You are a spring chicken!”
Report Question
0%
“You are aged to perfection!”
0%
"Wow, you are half a century old!"
0%
"You are a spring chicken!"
I am 18 years old! What will the output be?: IF you are 70 or older, say “You are aged to perfection!” ELIF you are exactly 50, say “Wow, you are half a century old!” ELSE say “You are a spring chicken!”
Report Question
0%
"You are aged to perfection"
0%
"Wow, you are half a century old!"
0%
"You are spring chicken!"
Is Python a Case Sensitive Language?
Report Question
0%
Yes
0%
No
0%
May not be
0%
None of the above
Which of the following is a invalid variable in Python
Report Question
0%
_a=1
0%
__a=1
0%
_str_=1
0%
None of the above
What is answer of this expression, 22 % 3 is?
Report Question
0%
7
0%
1
0%
0
0%
5
Mathematical operations can be performed on a string.
Report Question
0%
True
0%
False
0%
May not be
0%
None of the above
What is the output of the following?x = ['ab', 'cd']for i in x:i.upper()print(x)
Report Question
0%
[‘ab’, ‘cd’].
0%
[‘AB’, ‘CD’].
0%
None of the above
0%
[None, None]
What is the output of the following?i = 1while True:if i%2 == 0:breakprint(i)i += 2
Report Question
0%
1
0%
1 2
0%
1 2 3 4 5 6...
0%
1 3 5 7 9 11....
What is the output of the following?i = 0while i < 5: print(i) i += 1 if i == 3: breakelse: print(0)
Report Question
0%
0 1 2 0
0%
0 1 2
0%
error
0%
none of the mentioned
What is the output of the following?x = 'abcd'for i in range(x): print(i)
Report Question
0%
a b c d
0%
1 2 3 4
0%
error
0%
None of the above
What is the output of the following?for i in range(10): if i == 5: break else: print(i)else: print("Here")
Report Question
0%
0 1 2 3 4 Here
0%
0 1 2 3 4 5 Here
0%
0 1 2 3 4
0%
1 2 3 4 5
What is the output when following statement is executed ?>>>"a"+"bc"
Report Question
0%
a
0%
bc
0%
ac
0%
abc
What is the output when following statement is executed ?>>>"abcd"[2:]
Report Question
0%
a
0%
ab
0%
ac
0%
cd
What is the output when following code is executed ?>>> str1 = 'hello' >>> str2 = ',' >>> str3 = 'world' >>> str1[-1:]
Report Question
0%
olleh
0%
hello
0%
h
0%
o
What is the output of the following code ?>>>example = "snow world" >>>example[3] = 's'>>>print example
Report Question
0%
snow
0%
snow world
0%
error
0%
snos world
Which of the following commands will create a list? a) list1 = list() b) list1 = []. c) list1 = list([1, 2, 3]) d) all of the mentioned
Report Question
0%
list1 = list()
0%
list1 = [].
0%
list1 = list([1, 2, 3])
0%
all of the mentioned
Suppose list1 is [3, 5, 25, 1, 3], what is min(list1) ?
Report Question
0%
3
0%
5
0%
1
0%
25
Suppose list1 is [1, 5, 9], what is sum(list1) ?
Report Question
0%
1
0%
9
0%
15
0%
none
What will be the output?names1 = ['Amir', 'Bala', 'Chales']if 'amir' in names1: print(1) else: print(2)
Report Question
0%
None
0%
1
0%
2
0%
error
Which of the following is a Python tuple?
Report Question
0%
[1, 2, 3].
0%
(1, 2, 3)
0%
{1, 2, 3},
0%
{},
What will be the output?>>>t=(1,2,4,3) >>>t[1:3]
Report Question
0%
(1,2)
0%
(1,2,4)
0%
(2,4)
0%
(2,4,3)
What is the output of the following code?nums = set([1,1,2,3,3,3,4,4])print(len(nums))
Report Question
0%
7
0%
error
0%
4
0%
8
Which of the following statements create a dictionary?
Report Question
0%
d = {},
0%
d = {“john”:40, “peter”:45},
0%
d = {40:”john”, 45:”peter”},
0%
All of the mentioned
Read the code shown below carefully and pick out the keys?d = {"john":40, "peter":45},
Report Question
0%
“john”, 40, 45, and “peter”
0%
“john” and “peter”
0%
40 and 45
0%
None
What is the output of the expression:round(4.576)
Report Question
0%
4.5
0%
4
0%
5
0%
4.576
Which of the following functions is a built-in function in python?
Report Question
0%
seed()
0%
sqrt()
0%
factorial()
0%
print()
_____ represents an entity in the real world with its identity and behaviour
Report Question
0%
a method
0%
a object
0%
a class
0%
a operator
Which character is used in Python to make a comment?
Report Question
0%
/
0%
//
0%
#
0%
!
Stores a piece of data, and gives it a specific name
Report Question
0%
variable
0%
whitespace
0%
interpreter
0%
modulus
A Python statement won't try to run as code by a machine
Report Question
0%
comment
0%
modulus
0%
variable
0%
boolean
What does this function do? input()
Report Question
0%
Opens the CD tray.
0%
Asks the user to type something in.
0%
Displays the word 'input'.
0%
Exits the program.
What code would you use to get an average of your maths and English test results?
Report Question
0%
Average = (Maths+English)/2
0%
Average = Maths+English/2
0%
Average = (Maths+English)*2
0%
Average = Maths+English*2
True or False:Python can be used to make games and phone apps.
Report Question
0%
True
0%
False
Guess the output:a = 255b = 255a == b
Report Question
0%
True
0%
False
What is an integer?
Report Question
0%
A number with a decimal point.
0%
A whole number.
0%
An array of characters.
0%
A single character.
Which one of these is floor division?
Report Question
0%
/
0%
//
0%
%
0%
none of the above
The expression Int(x) implies that the variable x is converted to integer.
Report Question
0%
True
0%
False
0%
both
0%
None of above
Which of the following words cannot be a variable in python language?
Report Question
0%
_abc
0%
abc
0%
9abc
0%
ABC
What does this code do? print("Hello world!")
Report Question
0%
Displays 'Hello world!' in the shell window.
0%
Sends 'Hello world!' to the printer.
0%
Waits for the user to type in 'Hello world!'
0%
Displays 'hello, world.' in the shell window.
What symbol do you type in to add a short comment?
Report Question
0%
"""
0%
#
0%
@
0%
/
True or False:phone.number is a good name for a variable.
Report Question
0%
True
0%
False
True or False:5.0 is an example of the 'float' datatype.
Report Question
0%
True
0%
False
You write a program where the user types how many apples they want to buy. The program calculates the total cost and displays it on the screen in pounds. What is the output?
Report Question
0%
numberOfApples (integer)
0%
totalPrice = numberOfApples*25/100
0%
totalPrice (float)
0%
totalPrice = numberOfApples
What is the process of converting one datatype to another called?
Report Question
0%
Data conversion.
0%
Type Casting.
0%
Type Conversion.
0%
Concatenation.
Gjdk is not a good name for a variable, why?
Report Question
0%
It starts with a capital letter.
0%
It does not contain any spaces.
0%
There are no vowels.
0%
It's meaningless.
True or False:You need to convert an integer to a string before you can use it in the print() function.
Report Question
0%
True
0%
False
In this code, how much does an apple cost?
Report Question
0%
£1
0%
50p
0%
20p
0%
25p
True or False:There are no symbols which can be used in a variable name.
Report Question
0%
True
0%
False
What function converts the data in a variable into a 'float'?
Report Question
0%
int()
0%
flt()
0%
bool()
0%
float()
Comments are used to make code easier to read.
Report Question
0%
True
0%
False
Variable names can start with...
Report Question
0%
...only capital letters.
0%
...any number, letter or an underscore (_).
0%
...any letter or symbol.
0%
...any letter or an underscore (_).
You are asked to write a program where the user types in the amount of marks they got for a paper with 70 marks. The program then calculates and displays their score as a percentage. What is the process?
Report Question
0%
marks (integer)
0%
percentage (float)
0%
percentage = marks/100*70
0%
percentage = marks/70*100
What would the program display if you ran this code and entered 2 and then 3 when prompted?
Report Question
0%
The total is 5.
0%
The total is 23.
0%
The total is 6.
0%
An error.
x = 8print(x > 3 or x < 20)
Report Question
0%
True
0%
False
Which python operator means 'less than or equal to'?
Report Question
0%
>=
0%
>
0%
<
0%
<=
<=
Report Question
0%
less than
0%
less than or equal to
>=
Report Question
0%
greater than
0%
greater than or equal to
0%
not greater than
0%
not equal to
==
Report Question
0%
equal to
0%
assign a variable
0%
not equal to
0%
less than
! =
Report Question
0%
greater than variable
0%
less than variable
0%
equal to
0%
not equal to
6 > 5
Report Question
0%
TRUE
0%
FALSE
3<=4
Report Question
0%
TRUE
0%
FALSE
2 = = 3
Report Question
0%
TRUE
0%
FALSE
45 ! = 2
Report Question
0%
TRUE
0%
FALSE
Which operator would you use to assign a value to a variable?
Report Question
0%
=
0%
==
Which operator would you use to test a value is equal to another?
Report Question
0%
==
0%
=
Choose the correct Python code.Display: Welcome to the quiz!
Report Question
0%
print ("Welcome to the quiz!")
0%
print (Welcome to the quiz!)
x = 5print(x > 3 and x < 10)
Report Question
0%
True
0%
False
x = 10print(x > 3 and x < 9)
Report Question
0%
True
0%
False
x = 14print(x > 10 or x < 3)
Report Question
0%
True
0%
False
x = 5print(x < 2 or x < 3)
Report Question
0%
True
0%
False
x = 5print(not(x > 3 and x < 10))
Report Question
0%
True
0%
False
x = 5print(not(x > 6 or x < 3 ))
Report Question
0%
True
0%
False
x = 7print(x > 8 and x < 10)
Report Question
0%
True
0%
False
x = 100print(x < 10 or x < 80)
Report Question
0%
True
0%
False
Which data type is used to store:100
Report Question
0%
Integer
0%
Double
0%
Boolean
0%
String
This data type is used to store whole numbers
Report Question
0%
Integer
0%
Double
0%
Boolean
0%
String
This data type is used to store a mixture of letters and numbers and symbols.
Report Question
0%
String
0%
Character
0%
Boolean
0%
Integer
A variable is a named value that can be changed in the program.
Report Question
0%
False
0%
True
What is an Integer?
Report Question
0%
A data type that contains whole numbers. eg: 3, 45, 124
0%
Numbers with decimal point. eg: 0.5, 2.45, 56.04
0%
Group of characters between quotation marks. eg: "dog"
0%
Data type that can only be True or False.
What is a Float?
Report Question
0%
A data type that contains whole numbers. eg: 3, 45, 124
0%
Numbers with decimal point. eg: 0.5, 2.45, 56.04
0%
Group of characters between quotation marks. eg: "dog"
0%
Data type that can only be True or False.
What is a Boolean?
Report Question
0%
A data type that contains whole numbers. eg: 3, 45, 124
0%
Numbers with decimal point. eg: 0.5, 2.45, 56.04
0%
Group of characters between quotation marks. eg: "dog"
0%
Data type that can only be True or False.
Which data type is used to store:TRUE
Report Question
0%
Boolean
0%
Double
0%
String
0%
Integer
What will be the output?name = 'Dave'print (name)
Report Question
0%
Dave
0%
'Dave'
0%
name
0%
(name)
Syntax is...
Report Question
0%
the word used to describe an error
0%
is is used to read information
0%
the rules of the programming language
0%
it is used to output informaiton
A variable is...
Report Question
0%
a storage location
0%
a storage location that uses a symbolic name to store a value
0%
a storage location that uses mnemonic devices to hold a place on the hard drive for retrieval later
What type of loop could we use to make a square?
Report Question
0%
For
0%
Four
0%
While
0%
If Else
What is iteration?
Report Question
0%
Repeating an instruction 5 times
0%
Code
0%
Repeating an instruction an unlimited number of times
0%
Repeating an instruction until a goal is met
To make a comment in the code (that is not interpreted) use the following symbol:
Report Question
0%
*
0%
/
0%
{},
0%
#
When creating a "for" loop, the character that must appear at the end of "for i in range (4)" is which of the following:
Report Question
0%
;
0%
},
0%
)
0%
:
Find the error in the following code:wn = Turtle.Screen()
Report Question
0%
Alignment
0%
Syntax (Capitalization)
0%
Attribution Error
0%
Unassigned Variable
The following code creates a...
Report Question
0%
polygon
0%
parallelogram
0%
diamond
0%
rectangle
The following code creates a...
Report Question
0%
polygon
0%
parallelogram
0%
diamond
0%
rectangle
0:0:1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
0
Answered
0
Not Answered
0
Not Visited
Correct : 0
Incorrect : 0
Report Question
×
What's an issue?
Question is wrong
Answer is wrong
Other Reason
Want to elaborate a bit more? (optional)
Support mcqexams.com by disabling your adblocker.
×
Please disable the adBlock and continue.
Thank you.
Reload page