[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

2 / 40

2. Comments can be used to explain Python code.

3 / 40

3. Python is a  high-level programming language.

4 / 40

4. Most recent major version of Python is Python 3

5 / 40

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

6 / 40

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

7 / 40

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

a. 5

b. 3

c. 6

d. 7

8 / 40

8.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

9 / 40

9. Python has various versions available

10 / 40

10.

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.

11 / 40

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

12 / 40

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

13 / 40

13.

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

14 / 40

14. Which of the following is used to define a block of code in Python language?
a) Indentation
b) Key
c) Brackets
d) All of the mentioned

15 / 40

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

16 / 40

16.

 What is output of: 35 == 35.0

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

17 / 40

17.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

18 / 40

18. Python can be used on a server to create web applications?

19 / 40

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

20 / 40

20. You have to use the same number of spaces in the same block of code, otherwise Python will give you an error

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. Python has a set of built-in methods that you can use on lists/arrays

23 / 40

23.

What will be the output of above Python code?

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

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

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

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

28 / 40

28.

 ____________________ 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

29 / 40

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

30 / 40

30. The format() method takes the passed arguments

31 / 40

31.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

32 / 40

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

33 / 40

33.

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

34 / 40

34.

Which of the following is False?

A. String is immutable.
B. capitalize() function in string is used to return a string by converting the whole given string into uppercase.
C. lower() function in string is used to return a string by converting the whole given string into lowercase.
D. None of these.

35 / 40

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

36 / 40

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

37 / 40

37. Comments starts with a #

38 / 40

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

39 / 40

39.

How to copy one list to another in python?

A. l1[] = l2[]
B. l1[] = l2
C. l1[] = l2[:]
D. l1 = l2

40 / 40

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

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.