[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

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

4 / 40

4.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

5 / 40

5.

In the Python statement x = a + 5 – b:

a and b are ________a + 5 - b is ________
  1. terms, a group
  2. operators, a statement
  3. operands, an expression
  4. operands, an equation

6 / 40

6. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

7 / 40

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

8 / 40

8.

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

9 / 40

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

10 / 40

10. A variable name must start with a letter or the underscore character

11 / 40

11.

In a program, a function can be called ____________ times.

a. 2

b. 3

c. 5

d. Multiple times

12 / 40

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

13 / 40

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

14 / 40

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

15 / 40

15. Which of the following is the correct extension of the Python file?

16 / 40

16. Python relies on indentation?

17 / 40

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

18 / 40

18.

 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.

19 / 40

19.

The most important object defined in NumPy is an N-dimensional array type called?

A. ndarray
B. narray
C. nd_array
D. darray

20 / 40

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

21 / 40

21. Comments can’t be used to prevent execution when testing code.

22 / 40

22.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

23 / 40

23. Variable names are case-sensitive

24 / 40

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

25 / 40

25.

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

26 / 40

26. Extension of all Python  Programme are .py

27 / 40

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

28 / 40

28. Operators are used to perform operations on variables and values

29 / 40

29.

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

30 / 40

30.

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.

31 / 40

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

32 / 40

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

33 / 40

33. Is there any comments in  following codes

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

 

34 / 40

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

35 / 40

35. Variables that are created outside of a function

36 / 40

36. python has two primitive loop commands:

  • while loops
  • for loops

37 / 40

37. Python has various versions available

38 / 40

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

39 / 40

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

40 / 40

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

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.