[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. The elif keyword is pythons way of saying “if the previous conditions were not true, then try this condition”.

2 / 40

2. You can use three double quotes only:

a = “””Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.”””
print(a)

3 / 40

3.

 What is output of: 35 == 35.0

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

4 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

5 / 40

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

6 / 40

6.

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

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

7 / 40

7. The format() method takes the passed arguments

8 / 40

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

9 / 40

9.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

10 / 40

10. + operator is used  to get output of multiple variables

11 / 40

11. Most recent major version of Python is Python 3

12 / 40

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

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. Find and write the output of the following python code:

x = “abcdef”

i = “a”

while i in x:

print(i, end = ” “)

a) a

b) a a a a a a

c) a a a a a a … infinite times

d) Code will generate error

15 / 40

15. You can also have an else without the elif

16 / 40

16.

How to copy one list to another in python?

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

17 / 40

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

18 / 40

18. Python has various versions available

19 / 40

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

20 / 40

20. Which of the following is the use of function in python?
a) Functions are reusable pieces of programs
b) Functions don’t provide better modularity for your application
c) you can’t also create your own functions
d) All of the mentioned

21 / 40

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

22 / 40

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

a. 5

b. 3

c. 6

d. 7

23 / 40

23.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

24 / 40

24. Variables that are created outside of a function

25 / 40

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

26 / 40

26. break in Python is used ______________

a) To restart a loop

b) Terminate a loop

c) To jump in between the loop

d) None of the above

27 / 40

27. What is the output of the given below program?

if 1 + 3 == 7:    print("Hello")else:    print("Know Program")

a) Hello
b) Know Program
c) Compiled Successfully, No Output.
d) Error

28 / 40

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

29 / 40

29.

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

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

30 / 40

30. The else keyword catches anything which isn’t caught by the preceding conditions.

31 / 40

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

32 / 40

32.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

33 / 40

33. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

34 / 40

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

35 / 40

35. Bitwise operators are used to compare (binary) numbers

36 / 40

36. An array is a special variable, which can hold more than one value at a time

37 / 40

37.

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

38 / 40

38. python has two primitive loop commands:

  • while loops
  • for loops

39 / 40

39.

What will be the output of above Python code?

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

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

40 / 40

40. All keywords in Python are in _________
a) Capitalized
b) lower case
c) UPPER CASE
d) None of the mentioned

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.