[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

a. True

b. False

2 / 40

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

3 / 40

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

4 / 40

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

5 / 40

5.

What is the value of the expression 100 / 25?

  1. 4
  2. 4.0
  3. 0
  4. 25

6 / 40

6.

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

7 / 40

7. Comments can be used to explain Python code.

8 / 40

8. 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”

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

13. Most recent major version of Python is Python 3

14 / 40

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

15 / 40

15. X wants to allow the program to repeatedly ask the user to enter their Choice if it does not equal the Answer. Which loop option should X use?

a) while Choice == Answer:

Choice = input()

b) while Choice != Answer:

Choice = input()

c) while Answer != Choice:

Choice = input()

d) while Answer =! Choice:

Choice = input()

 

16 / 40

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

17 / 40

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

18 / 40

18.

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

19 / 40

19. What keyword would you use to add an alternative condition to an if statement?

a) else if
b) elseif
c) elif
d) None of the above

20 / 40

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

21 / 40

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

22 / 40

22.

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

23 / 40

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

24 / 40

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

25 / 40

25.

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

a. Define

b. DEF

c. def

d. Def

26 / 40

26.

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

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

27 / 40

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

28 / 40

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

29 / 40

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

30 / 40

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

31 / 40

31.

What will the below Python code will return?

If str1="save paper,save plants"str1.find("save")

A. It returns the first index position of the first occurance of “save” in the given string str1.
B. It returns the last index position of the last occurance of “save” in the given string str1.
C. It returns the last index position of the first occurance of “save” in the given string str1.
D. It returns the first index position of the first occurance of “save” in the given string str1.

32 / 40

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

33 / 40

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

34 / 40

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

35 / 40

35. The length of an array is always one more than the highest array index.

36 / 40

36. You can also have an else without the elif

37 / 40

37. Python is a  high-level programming language.

38 / 40

38.

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.

39 / 40

39.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

40 / 40

40. Variables that are created outside of a function

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.