[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. python file can also run on command line

2 / 40

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

3 / 40

3. Find the output of the following program segments:

for i in range(20,30,2):

print(i)

a) 20 22 24 26 28

b) 20

22

24

26

28

c) 20 22 24 26 28 30

d) 20

22

24

26

28

30

4 / 40

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

5 / 40

5. Arithmetic operators are used with numeric values to perform common mathematical operations

6 / 40

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

7 / 40

7.

Which of the following statement will execute in last?

def s(n1): #Statement 1      print(n1) #Statement 2n2=4 #Statement 3s(n2) #Statement 4

a. Statement 1

b. Statement 2

c. Statement 3

d. Statement 4

8 / 40

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

9 / 40

9.

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

a. Define

b. DEF

c. def

d. Def

10 / 40

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

11 / 40

11.

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

a. True

b. False

12 / 40

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

13 / 40

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

14 / 40

14. The format() method takes the passed arguments

15 / 40

15. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

16 / 40

16. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

17 / 40

17.

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

18 / 40

18. Pascal Case
Each word starts with a capital letter:

19 / 40

19.

 Select the correct example of complex datatype in Python

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

20 / 40

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

21 / 40

21. Who developed Python Programming Language?

22 / 40

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

23 / 40

23.

What do we use to define a block of code in Python language?

  1. Key
  2. Brackets
  3. Indentation
  4. None of these

24 / 40

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

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.

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

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

27 / 40

27.

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.

28 / 40

28. You can also have an else without the elif

29 / 40

29. You can use the append() method to add an element to an array

30 / 40

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

31 / 40

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

32 / 40

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

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

a) 1 2
b) 1 2 3
c) error
d) none of the mentioned

33 / 40

33. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

39.

 ____________________ 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

40 / 40

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

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.