[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. The for loop does not require an indexing variable to set beforehand

2 / 40

2.

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

a. 2

b. 3

c. 5

d. Multiple times

3 / 40

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

4 / 40

4.

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

5 / 40

5.

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

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

6 / 40

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

7 / 40

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

8 / 40

8. You can use three double quotes only:

a = “””Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.”””
print(a)

9 / 40

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

10 / 40

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

11 / 40

11. Extension of all Python  Programme are .py

12 / 40

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

13 / 40

13. Official site of python is www.python.org

14 / 40

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

15 / 40

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

16 / 40

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

17 / 40

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

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 do we use to define a block of code in Python language?

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

20 / 40

20.

 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.

21 / 40

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

22 / 40

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

23 / 40

23.

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

24 / 40

24. python file can also run on command line

25 / 40

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

26 / 40

26. Python is an interpreted programming language

27 / 40

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

28 / 40

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

29 / 40

29.

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.

30 / 40

30. What is the index value of ‘i’ in string “Learning”

a. 5

b. 3

c. 6

d. 7

31 / 40

31. Comparison operators are not  used to compare two values

32 / 40

32.

Which function overloads the >> operator?

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

33 / 40

33. A variable name can only contain alpha-numeric characters and
underscores

34 / 40

34.

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.

35 / 40

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

36 / 40

36. Variables that are created outside of a function

37 / 40

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

38 / 40

38. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

39 / 40

39.

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

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

40 / 40

40. Which of the following is used to define a block of code in Python language?
a) Indentation
b) Key
c) Brackets
d) All of the mentioned

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.