[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

2 / 40

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

3 / 40

3.

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

4 / 40

4. All keywords in Python are in _________
a) Capitalized
b) lower case
c) UPPER CASE
d) None of the mentioned

5 / 40

5. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

6 / 40

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

7 / 40

7. A variable name cannot start with a number

8 / 40

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

9 / 40

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

10 / 40

10. What is the index value of ‘i’ in string “Learning”

a. 5

b. 3

c. 6

d. 7

11 / 40

11. Who developed Python Programming Language?

12 / 40

12. Python is an interpreted programming language

13 / 40

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

14 / 40

14.

 Select the correct example of complex datatype in Python

  1. 3 + 2j
  2. -100j
  3. 5j
  4. All of the above are correct

15 / 40

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

16 / 40

16.

What is the value of the expression 100 / 25?

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

17 / 40

17. Comments starts with a #

18 / 40

18.

What will be the output of below Python code?

str1="Information"print(str1[2:8])

A. format
B. formatio
C. orma
D. ormat

19 / 40

19.

What will the below Python code will return?

If str1="save paper,save plants"str1.find("save")

A. It returns the first index position of the first occurance of “save” in the given string str1.
B. It returns the last index position of the last occurance of “save” in the given string str1.
C. It returns the last index position of the first occurance of “save” in the given string str1.
D. It returns the first index position of the first occurance of “save” in the given string str1.

20 / 40

20. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

21 / 40

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

22 / 40

22. Strings in python are surrounded by either single quotation marks, or double quotation marks

23 / 40

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

24 / 40

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

25 / 40

25. You can also have an else without the elif

26 / 40

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

27 / 40

27.

Which is the correct operator for power(xy)?

  1. X^y
  2. X**y
  3. X^^y
  4. None of the mentioned

28 / 40

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

29 / 40

29. Which of the following loop is not supported by the python programming language?

a) for loop

b) while loop

c) do…while loop

d) None of the above

30 / 40

30.

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

31 / 40

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

32 / 40

32.

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

a. 2

b. 3

c. 5

d. Multiple times

33 / 40

33. python file can also run on command line

34 / 40

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

35 / 40

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

36 / 40

36.

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

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

37 / 40

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

38 / 40

38.

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

39 / 40

39. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

40 / 40

40. Find the output of the given Python program?

a, b, c = 1, 3, 5if a > 0:  if b < 2:    print("Hi")  elif c > 3:    print("Hello")else:  print("Know Program")

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

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.