[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Identity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with the same memory location

2 / 40

2. You have to use the same number of spaces in the same block of code, otherwise Python will give you an error

3 / 40

3. X wants to allow the program to repeatedly ask the user to enter their Choice if it does not equal the Answer. Which loop option should X use?

a) while Choice == Answer:

Choice = input()

b) while Choice != Answer:

Choice = input()

c) while Answer != Choice:

Choice = input()

d) while Answer =! Choice:

Choice = input()

 

4 / 40

4. The format() method takes the passed arguments

5 / 40

5. Arithmetic operators are used with numeric values to perform common mathematical operations

6 / 40

6. We can combine strings and numbers by using the format() method

7 / 40

7. You can also have an else without the elif

8 / 40

8. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

9 / 40

9.

l = [ 4, 8, 9, 2.6, 5 ] is a type of which data type in python?

  1. List
  2. Tuple
  3. Set
  4. None of these

10 / 40

10. Comments can be used to make the code more readable.

11 / 40

11. Python can be used on a server to create web applications?

12 / 40

12. What is the output of the given below program?

if 3 + 4 == 7:    print("Hi")else:    print("Know Program")print("Hello")

a) Hi
b) Know Program

c)
Hi
Hello

d)
Know Program
Hello

13 / 40

13. Find and write the output of the following python code:

x = “abcdef”

i = “a”

while i in x:

print(i, end = ” “)

a) a

b) a a a a a a

c) a a a a a a … infinite times

d) Code will generate error

14 / 40

14. You can have if statements inside if statements, this is called nested if statements.

15 / 40

15. Python has various versions available

16 / 40

16. You can use the pop() method to remove an element from the array

17 / 40

17.

Which of the following is not a keyword in Python language?

  1. val
  2. raise
  3. try
  4. with

18 / 40

18.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

19 / 40

19. The length of an array is always one more than the highest array index.

20 / 40

20. Python is an interpreted programming language

21 / 40

21. Python can be used to handle big data and perform complex mathematics.

22 / 40

22.

The most important object defined in NumPy is an N-dimensional array type called?

A. ndarray
B. narray
C. nd_array
D. darray

23 / 40

23. Suppose t = (1, 2, 4, 3), which of the following is incorrect?
a) print(t[3])
b) t[3] = 45
c) print(max(t))
d) print(len(t))

24 / 40

24. Most recent major version of Python is Python 3

25 / 40

25. Python will give you an error if you skip the indentation

26 / 40

26. Bitwise operators are used to compare (binary) numbers

27 / 40

27. Variable names are case-sensitive

28 / 40

28. Find the output of the given Python program?

a = 25if a < 15:    print("Hi")if a <= 30:    print("Hello")else:    print("Know Program")

a) Hi
b) Hello
c) Know Program
d) Compiled Successfully, No Output.

29 / 40

29. Pip is  not a powerful package management system for Python software packages

30 / 40

30. Is Python code compiled or interpreted?
a) Python code is both compiled and interpreted
b) Python code is neither compiled nor interpreted
c) Python code is only compiled
d) Python code is only interpreted

31 / 40

31.

Which of the following statements assigns the value 25 to the variable x in Python:

  1. x ← 25
  2. x = 25
  3. x := 25
  4. int x = 25
  5. x << 25

32 / 40

32. The for loop does not require an indexing variable to set beforehand

33 / 40

33. The len() method to return the length of an array

34 / 40

34. Arrays are used to store multiple values in one single variable.

35 / 40

35.

In the Python statement x = a + 5 – b:

a and b are ________a + 5 - b is ________
  1. terms, a group
  2. operators, a statement
  3. operands, an expression
  4. operands, an equation

36 / 40

36. You can also use the remove() method to remove an element from the array

37 / 40

37. Find the output of the following program segments:

for i in range(20,30,2):

print(i)

a) 20 22 24 26 28

b) 20

22

24

26

28

c) 20 22 24 26 28 30

d) 20

22

24

26

28

30

38 / 40

38. The list’s remove() method only removes the first occurrence of the specified value.

39 / 40

39. print() function is often used to output variables.

40 / 40

40.

 ____________________ can be defined as a named group of instructions that accomplish a specific task when it is invoked/called.

a. Function

b. Datatype

c. Token

d. Operator

Exit



[hurrytimer id=”2250″]
[wooct_product]

Wrong shortcode initialized


You must log in to see your results.



Wrong shortcode initialized


There are no questions atteched yet.





[ays_quiz_leaderboard id=”Your_Quiz_ID” from=”Y-m-d H:i:sa” to=”Y-m-d H:i:s”]

Category:


Wrong shortcode initialized


[WATU 1]

You must log in to see your results.