[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

Write the output of the following code :

str = "Welcome"str[2] = 'a'print(str)

a. Weacome

b. Error

c. aWelcome

d. Welcomea

2 / 40

2.

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

a. True

b. False

3 / 40

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

4 / 40

4. Python has various versions available

5 / 40

5.

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

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

6 / 40

6.

 Select the correct example of complex datatype in Python

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

7 / 40

7. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

8 / 40

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

9 / 40

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

10 / 40

10.

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

11 / 40

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

12 / 40

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

13 / 40

13. To insert characters that are illegal in a string, use an escape character

14 / 40

14.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

15 / 40

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

16 / 40

16.

The function can be called in the program by writing function name followed by ____

a. [ ]

b. { }

c. ( )

d. None of the above

17 / 40

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

18 / 40

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

19 / 40

19.

What is the data type of print(type(10))

20 / 40

20.

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

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

21 / 40

21.

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.

22 / 40

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

23 / 40

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

24 / 40

24. Python is a  high-level programming language.

25 / 40

25. Camel Case
Each word, except the first, starts with a capital letter:

26 / 40

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

27 / 40

27.

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

28 / 40

28.

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

29 / 40

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

30 / 40

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

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.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

36.

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

37 / 40

37. Is there any comments in  following codes

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

 

38 / 40

38. The format() method takes the passed arguments

39 / 40

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

40 / 40

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

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.