[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Python is a  high-level programming language.

2 / 40

2.

Which of the following precedence order is correct in Python?

  1. Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
  2. Multiplication, Division, Addition, Subtraction, Parentheses, Exponential
  3. Division, Multiplication, Addition, Subtraction, Parentheses, Exponential
  4. Exponential, Parentheses, Multiplication, Division, Addition, Subtraction

3 / 40

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

4 / 40

4. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

5 / 40

5. 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

6 / 40

6.

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

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

7 / 40

7. Comparison operators are not  used to compare two values

8 / 40

8.

What is the data type of print(type(10))

9 / 40

9. You can use the append() method to add an element to an array

10 / 40

10.

What will be the output of below Python code?

str1="poWer"str1.upper()print(str1)

A. POWER
B. Power
C. power
D. poWer

11 / 40

11. When does the else statement written after loop executes?

a) When loop condition becomes false

b) When break statement is executed in the loop

c) else statement is always executed

d) None of the above

12 / 40

12. An array is a special variable, which can hold more than one value at a time

13 / 40

13.

What is the value of the expression 100 / 25?

  1. 4
  2. 4.0
  3. 0
  4. 25

14 / 40

14. Comments starts with a #

15 / 40

15. An array can hold many values under a single name

16 / 40

16. 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

17 / 40

17.

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

18 / 40

18. Python relies on indentation?

19 / 40

19. Python can be treated in a procedural way, an object-oriented way or a functional way.

20 / 40

20.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

21 / 40

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

22 / 40

22. What keyword would you use to add an alternative condition to an if statement?

a) else if
b) elseif
c) elif
d) None of the above

23 / 40

23. To insert characters that are illegal in a string, use an escape character

24 / 40

24. Which term describes a loop that continues repeating without a terminating (ending) condition?

a) Infinite Loop

b) Conditional Loop

c) Unlimited Loop

d) Sequence Loop

25 / 40

25. 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()

 

26 / 40

26.

The function can be called in the program by writing function name followed by ____

a. [ ]

b. { }

c. ( )

d. None of the above

27 / 40

27. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

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. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

30 / 40

30.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

31 / 40

31. Operators are used to perform operations on variables and values

32 / 40

32. Python can connect to database systems.

33 / 40

33. What will be the output of the following Python code?

x = ['ab', 'cd']for i in x:    i.upper()print(x)

a) [‘ab’, ‘cd’]
b) [‘AB’, ‘CD’]
c) [None, None]
d) none of the mentioned

34 / 40

34.

Function defined to achieve some task as per the programmer’s requirement is called a ___________

a. user defined function

b. library function

c. built in functions

d. All of the above.

35 / 40

35. Snake Case
Each word is separated by an underscore character:

36 / 40

36.

Which of the following statement will execute in last?

def s(n1): #Statement 1      print(n1) #Statement 2n2=4 #Statement 3s(n2) #Statement 4

a. Statement 1

b. Statement 2

c. Statement 3

d. Statement 4

37 / 40

37.

In a program, a function can be called ____________ times.

a. 2

b. 3

c. 5

d. Multiple times

38 / 40

38.

Which one of the following is the correct extension of the Python file?

  1. .py
  2. .python
  3. .p
  4. None of these

39 / 40

39. A variable name must start with a letter or the underscore character

40 / 40

40. With the break statement we can stop the loop before it has looped through all the items

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.