[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

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

4 / 40

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

5 / 40

5. Comments can be used to make the code more readable.

6 / 40

6. A variable name cannot start with a number

7 / 40

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

8 / 40

8.

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.

9 / 40

9. python has two primitive loop commands:

  • while loops
  • for loops

10 / 40

10. You can also have an else without the elif

11 / 40

11. Python has a set of built-in methods that you can use on lists/arrays

12 / 40

12. Python relies on indentation?

13 / 40

13.

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

14 / 40

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

15 / 40

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

16 / 40

16. Python is an interpreted programming language

17 / 40

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

18 / 40

18. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

19 / 40

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

20 / 40

20.

What will be the output of below Python code?

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

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

21 / 40

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

22 / 40

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

23 / 40

23.

Which function overloads the >> operator?

  1. more()
  2. gt()
  3. ge()
  4. None of the above

24 / 40

24. The for loop in Python is an _____________

a) Entry Controlled Loop

b) Exit Controlled Loop

c) Both of the above

d) None of the above

25 / 40

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

26 / 40

26.

 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.

27 / 40

27. Indentation refers to the spaces at the beginning of a code line.

28 / 40

28. Python can connect to database systems.

29 / 40

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

30 / 40

30. Variable names are case-sensitive

31 / 40

31. Python can be install on both  Linux and  Windows

32 / 40

32. Variables that are created outside of a function

33 / 40

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

 

34 / 40

34.

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

35 / 40

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

36 / 40

36.

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

a. True

b. False

37 / 40

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

38 / 40

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

39 / 40

39.

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.

40 / 40

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

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.