[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. Python has various versions available

3 / 40

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

4 / 40

4. python has two primitive loop commands:

  • while loops
  • for loops

5 / 40

5. Variables that are created outside of a function

6 / 40

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

7 / 40

7.

 What is output of: 35 == 35.0

  1. False
  2. True
  3. 33
  4. None of the above

8 / 40

8. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

9 / 40

9.

 Select the correct example of complex datatype in Python

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

10 / 40

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

11 / 40

11. You can also have multiple else statements on the same line:

12 / 40

12. A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).

13 / 40

13. Python is an interpreted programming language

14 / 40

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

15 / 40

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

16 / 40

16.

What will be the output of below Python code?

tupl=([2,3],"abc",0,9)tupl[0][1]=1print(tupl)A. ([2,3],"abc",0,9)B. ([1,3],"abc",0,9)C. ([2,1],"abc",0,9)D. Error

17 / 40

17.

 ____________________ can be defined as a named group of instructions that accomplish a specific task when it is invoked/called.

a. Function

b. Datatype

c. Token

d. Operator

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

21.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

22 / 40

22. Python can connect to database systems.

23 / 40

23. Indentation refers to the spaces at the beginning of a code line.

24 / 40

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

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

a) 1 2
b) 1 2 3
c) error
d) none of the mentioned

25 / 40

25.

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

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. Comments starts with a #

28 / 40

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

29 / 40

29. A variable name cannot start with a number

30 / 40

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

31 / 40

31. A variable name can only contain alpha-numeric characters and
underscores

32 / 40

32. Python relies on indentation?

33 / 40

33.

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.

34 / 40

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

35 / 40

35.

What will be the output of below Python code?

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

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

36 / 40

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

37 / 40

37.

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

38 / 40

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

39 / 40

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

40 / 40

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

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.