1/45
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
Those who are using Python programming are called as:
A. Python Café
B. Python Forest
C. Pythonistas
D. Monty Python’s Flying Circus
C. Pythonistas
A complete set of commands is known as:
A. Instruction list
B. Code laws
C. Command line
D. Command list
D. Command list
Which of the following are the correct statements?
A. True + 1 evaluates to 2
B. True and False evaluates to False
C. True or False evaluates to False
D. 7 + False evaluates to False
A. True + 1 evaluates to 2
B. True and False evaluates to False
Who created Python?
A. Guido ban Rossum
B. Guido van Rossum
C. Guido the Russian
D. Guodo van Rossum
B. Guido van Rossum
Python is known as:
A. A compiled language
B. An interpreted language
C. A machine language
D. An assembly language
B. An interpreted language
Which of the following is a valid Python comment?
A. <!-- comment -->
B. /* comment */
C. # comment
D. // comment
C. # comment
Python is a:
A. Low-level language
B. High-level language
C. Middle-level language
D. Machine-level language
B. High-level language
What will be the output of the following pseudocode:
Initialize x as 10;
If x is of type int,
print "Integer"
else
print "Not Integer"A. Integer
B. Not Integer
C. Error
D. None
A. Integer
What will be the output of:print("Python", "Programming", sep="-")
A. Python-Programming
B. Python Programming
C. PythonProgramming
D. Python,Programming
A. Python-Programming
What is the output of:
print("Hello", end='@');
print("World")A. HelloWorld
B. Hello@World
C. Hello World
D. Hello@ Wo
B. Hello@World
Pseudocode:
Ask user for number, multiply by 2, print result
A. Reads number, prints double
B. Reads string, prints same
C. Error in input
D. No output
A. Reads number, prints double
Identify the error:print("Hello World"))
A. Missing quotation marks
B. Extra parenthesis
C. Missing parenthesis
D. No error
B. Extra parenthesis
Find the mistake:
user_input = input("Enter a number: ")
print("You entered:", int(user_input))A. Syntax error
B. No error
C. int() should be str()
D. input() function used incorrectly
C. int() should be str()
Pseudocode:
Set x = 10
While x > 0,
decrement x by 1
print xA. Prints numbers from 10 to 1
B. Prints numbers from 1 to 10
C. Prints numbers from 9 to 0
D. Infinite loop
C. Prints numbers from 9 to 0
Pseudocode:
For numbers 1 to 5, print number if it’s odd
A. Prints 1 3 5
B. Prints 2 4
C. Prints all numbers 1 to 5
D. No output
A. Prints 1 3 5
Which of the following codes is correct?
A. print("Programming is fun") print("Python") print("Computer Engineering")
B. print("Programming is fun") print("Python") print("Computer Engineering")
C. print("Programming is fun") print("Python") print("Computer Engineering")
D. print("Programming is fun") print("Python") print("Computer Engineering")
All of the above
What function do you use to read a string?
A. input("Enter a string")
B. eval(input("Enter a string"))
C. center("Enter a string")
D. eval("Enter a string")
A. input("Enter a string")
If you enter 1, 2, 3 in three separate lines, what will be displayed by this program?
number1 = input()
number2 = input()
number3 = input()
average = (number1 + number2 + number3) / 3
print(average)
A. 1.0
B. 2.0
C. 3.0
D. Runtime error
D. Runtime error
You can place the line continuation symbol ___ at the end of a line to tell the interpreter the statement is continued on the next line.
A. /
B. \
C. #
D. &
B. \
Which of the following is a valid identifier?
A. $343
B. mile
C. 9X
D. 8+9
B. mile
Which of the following statements are the same?
A. x -= x + 4
B. x = x + 4 - x
C. x = x - (x + 4)
A. A and B
B. A and C
C. B and C
D. All of the above
B. A and C
What is x if x = 1
y = 2
x *= y + 1?
A. x is 1
B. x is 2
C. x is 3
D. x is 4
C. x is 3
Which of the following symbols are used for paragraph commenting?
A. “”
B. /* */
C. ‘‘‘
D. #
C. ‘‘‘
Which of the following is a valid file extension of a Python source code program?
A. .cpp
B. .c
C. .py
D. .obj

What will be the printed value of Y if A = 12?
A. 10
B. 20
C. 30
D. 40
A. 10

What will be the printed value of Y if A = 3?
A. -1
B. -2
C. -4
D. -5

What will be the printed value of Y if A = -4?
A. -18
B. -4
C. -15
D. -10

What will be the printed value of Y if A = 10?
A. 10
B. 20
C. 30
D. 40
What is the output of the following code:
print(0.3 + 0.5 == 0.8)
A. True
B. False
C. Error
D. Machine dependent
Why do computers use zeros and ones?
A. Because combinations of zeros and ones can represent any number
B. Because digital devices have two states
C. Because binary numbers are simplest
D. Because binary numbers are the base of all systems
_______ is the physical aspect of the computer that can be seen.
A. Hardware
B. Software
C. Operating system
D. Application program
Computer can execute the code in:
A. Machine language
B. Assembly language
C. High-level language
D. None of the above
_______ translates high-level language program into machine language program.
A. An assembler
B. A compiler
C. CPU
D. The operating system
Which of the following statements is true?
A. Python 3 is backward compatible with Python 2
B. Python 3 is not backward compatible with Python 2
C. Python 2 programs always run on Python 3
D. Python 3 programs always run on Python 2
In Python, a syntax error is detected by the:
A. Compiler at compile time
B. Interpreter at runtime
C. Compiler at runtime
D. Interpreter at compile time
_______ is the code in natural language mixed with some program code.
A. Python program
B. Python statement
C. Pseudocode
D. Flowchart diagram
What is displayed in the following code?
x = 1
y = x + 1
print("y is", y)A. y is 0
B. y is 1
C. y is 2
D. Error
If a number is too large to be stored in memory, it:
A. Causes overflow
B. Causes underflow
C. Causes no error
D. Cannot happen in Python
What is the result of evaluating 2 + 2 ** 3 / 2?
A. 4.0
B. 6.0
C. 7.5
D. 8.0
What is the value of i printed?
j = 1
i = j + 5
print("What is i?", i)A. 0
B. 5
C. 6
D. 7
Which type of programming does Python support?
A. Object-oriented programming
B. Structured programming
C. Functional programming
D. All of the mentioned
Which of the following is used to define a block of code in Python?
A. Indentation
B. Key
C. Brackets
D. All of the mentioned
Which of the following characters represent exponentiation in Python?
A. ^
B. %
C. **
D. $

44. How many times will the string “Yoyo” be printed if the value of X is 8?
A. 6
B. 7
C. 8
D. 10
B. 7

What will be the value of X so that will make the string “Bye” be displayed?
A. X is equal to zero (0)
B. X is an even nymber
C. X is an odd number
D. X is negative value
A. X is equal to zero (0)

How many times will the string “Yoyo” be printed if the value of X = 10?
A. 1
B. 3
C. 7
D. 5
9 times