[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Most recent major version of Python is Python 3

2 / 40

2. Comparison operators are not  used to compare two values

3 / 40

3. The for loop in Python is an _____________

a) Entry Controlled Loop

b) Exit Controlled Loop

c) Both of the above

d) None of the above

4 / 40

4. Which keyword is used for function?
a) Fun
b) Define
c) Def
d) Function

5 / 40

5.

Which function overloads the >> operator?

  1. more()
  2. gt()
  3. ge()
  4. None of the above

6 / 40

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

7 / 40

7.

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

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

8 / 40

8. Comments can’t be used to prevent execution when testing code.

9 / 40

9. You can use three double quotes only:

a = “””Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.”””
print(a)

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.

Which statement is correct?

A. List is immutable && Tuple is mutable
B. List is mutable && Tuple is immutable
C. Both are Mutable.
D. Both are Immutable

12 / 40

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

13 / 40

13.

Which of the following creates a tuple?

A. tuple1=(“a”,”b”)
B. tuple1[2]=(“a”,”b”)
C. tuple1=(5)*2
D. None of the above

14 / 40

14.

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

15 / 40

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

16 / 40

16. python has two primitive loop commands:

  • while loops
  • for loops

17 / 40

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

18 / 40

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

19 / 40

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

20 / 40

20.

In Python, a variable may be assigned a value of one type, and then later assigned a value of a different type:

  1. False
  2. True

21 / 40

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

22 / 40

22. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

23 / 40

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

24 / 40

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

25 / 40

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

26 / 40

26. Which of the following character is used to give single-line comments in Python?
a) //
b) #
c) !
d) /*

27 / 40

27. Which of the following is the correct extension of the Python file?

28 / 40

28. During Installation Make sure to select both the checkboxes at the bottom .

29 / 40

29.

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

30 / 40

30. Which of the following is used to define a block of code in Python language?
a) Indentation
b) Key
c) Brackets
d) All of the mentioned

31 / 40

31. An example of an illegal character is a double quote inside a string that is surrounded by double quotes

32 / 40

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

33 / 40

33. To write and execute code in python, we first need to install Python on our system

34 / 40

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

35 / 40

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

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. What does the following code print?

x = -10if x < 0:    print("The negative number ",  x, " is not valid here.")print("This is always printed")
a.This is always printedb.The negative number -10 is not valid hereThis is always printedc.The negative number -10 is not valid here

38 / 40

38. The else keyword catches anything which isn’t caught by the preceding conditions.

39 / 40

39. Python relies on indentation?

40 / 40

40.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

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.