[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

2 / 40

2. With the for loop we can execute a set of statements

3 / 40

3. Python allows you to extract the values into variables.

4 / 40

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

5 / 40

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

6 / 40

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

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.

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

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

9 / 40

9. Python is an interpreted programming language

10 / 40

10.

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

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

11 / 40

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

12 / 40

12. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

13 / 40

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

14 / 40

14.

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

15 / 40

15. Python has various versions available

16 / 40

16.

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

17 / 40

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

18 / 40

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

19 / 40

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

20 / 40

20.

What is the data type of print(type(0xFF))

21 / 40

21.

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.

22 / 40

22.

Python considered the character enclosed in triple quotes as String.(T/F)

a. True

b. False

23 / 40

23. Extension of all Python  Programme are .py

24 / 40

24. Python relies on indentation?

25 / 40

25. With the break statement we can stop the loop even if the while condition is true

26 / 40

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

27 / 40

27. Variables that are created outside of a function

28 / 40

28.

What will be the output of above Python code?

str1="6/4"print("str1")

A. 1
B. 6/4
C. 1.5
D. str1

29 / 40

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

30 / 40

30. Python has a set of built-in methods that you can use on lists/arrays

31 / 40

31. Comments starts with a #

32 / 40

32. Python  was created by Guido van Rossum, and released in 1999.

33 / 40

33. Can we write if/else into one line in python?

a) Yes
b) No
c) if/else not used in python
d) None of the above

34 / 40

34.

 Select the correct example of complex datatype in Python

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

35 / 40

35. Variable names are case-sensitive

36 / 40

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

37 / 40

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

38 / 40

38. Comparison operators are not  used to compare two values

39 / 40

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

40 / 40

40.

What do we use to define a block of code in Python language?

  1. Key
  2. Brackets
  3. Indentation
  4. None of these

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.