[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

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

4 / 40

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

5 / 40

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

6 / 40

6. Who developed Python Programming Language?

7 / 40

7.

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

8 / 40

8.

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.

9 / 40

9.

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

a. True

b. False

10 / 40

10. A variable name cannot start with a number

11 / 40

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

12 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

13 / 40

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

14 / 40

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

15 / 40

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

16 / 40

16. Python has various versions available

17 / 40

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

18 / 40

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

19 / 40

19.

What is the value of the expression 100 / 25?

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

20 / 40

20.

Choose the correct option with respect to Python.

A. Both tuples and lists are immutable.
B. Tuples are immutable while lists are mutable.
C. Both tuples and lists are mutable.
D. Tuples are mutable while lists are immutable.

21 / 40

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

22 / 40

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

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. Strings in python are surrounded by either single quotation marks, or double quotation marks

25 / 40

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

26 / 40

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

 

27 / 40

27. Official site of python is www.python.org

28 / 40

28. Python can be install on both  Linux and  Windows

29 / 40

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

30 / 40

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

31 / 40

31.

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

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

32 / 40

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

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

36. The format() method takes the passed arguments

37 / 40

37. Which of the following is a Python tuple?
a) [1, 2, 3]
b) (1, 2, 3)
c) {1, 2, 3}
d) {}

38 / 40

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

39 / 40

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

40 / 40

40.

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

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.