[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. Python will give you an error if you skip the indentation

3 / 40

3.

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

4 / 40

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

5 / 40

5. Variable names are case-sensitive

6 / 40

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

7 / 40

7. You can also have an else without the elif

8 / 40

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

9 / 40

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

10 / 40

10.

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

11 / 40

11.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

12 / 40

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

13 / 40

13. You can return a range of characters by using the slice syntax

14 / 40

14. Who developed Python Programming Language?

15 / 40

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

16 / 40

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

17 / 40

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

18 / 40

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

 

19 / 40

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

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. Which of the following character is used to give single-line comments in Python?
a) //
b) #
c) !
d) /*

22 / 40

22.

What will be the output of below Python code?

str1="Information"print(str1[2:8])

A. format
B. formatio
C. orma
D. ormat

23 / 40

23. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

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. The elif keyword is pythons way of saying “if the previous conditions were not true, then try this condition”.

26 / 40

26. You can also use the remove() method to remove an element from the array

27 / 40

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

28 / 40

28. The format() method takes the passed arguments

29 / 40

29.

 ____________________ 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

30 / 40

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

31 / 40

31. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

32 / 40

32.

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

33 / 40

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

34 / 40

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

35 / 40

35.

How to copy one list to another in python?

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

36 / 40

36. Snake Case
Each word is separated by an underscore character:

37 / 40

37. To write and execute code in python, we first need to install Python on our system

38 / 40

38. Python has various versions available

39 / 40

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

40 / 40

40.

The function can be called in the program by writing function name followed by ____

a. [ ]

b. { }

c. ( )

d. None of the above

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.