[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3. The format() method takes the passed arguments

4 / 40

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

5 / 40

5.

Which keyword is used to begin the definition of a function?

a. Define

b. DEF

c. def

d. Def

6 / 40

6. Find the output of the given Python program?

a, b, c = 1, 3, 5if a > 0:  if b < 2:    print("Hi")  elif c > 3:    print("Hello")else:  print("Know Program")

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

7 / 40

7.

What will be the output of below Python code?

str1="poWer"str1.upper()print(str1)

A. POWER
B. Power
C. power
D. poWer

8 / 40

8. Python can be install on both  Linux and  Windows

9 / 40

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

10 / 40

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

11 / 40

11. A variable name cannot start with a number

12 / 40

12.

 Select the correct example of complex datatype in Python

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

13 / 40

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

14 / 40

14.

What is the data type of print(type(0xFF))

15 / 40

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

16 / 40

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

  1. d = {"john":40, "peter":45}
  2. d["john"]

a) 40
b) 45
c) “john”
d) “peter”

17 / 40

17. python has two primitive loop commands:

  • while loops
  • for loops

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

21.

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

22 / 40

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

23 / 40

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

24 / 40

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

25 / 40

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

26 / 40

26. The format() method takes unlimited number of arguments

27 / 40

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

28 / 40

28.

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.

29 / 40

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

30 / 40

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

31 / 40

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

32 / 40

32. Python is an interpreted programming language

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

36. Variables that are created outside of a function

37 / 40

37.

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.

38 / 40

38. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

39 / 40

39.

 Which of the following statement is False?

  1. Variable names can be arbitrarily long.
  2. They can contain both letters and numbers.
  3. Variable name can begin with underscore.
  4. Variable name can begin with number.

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.