[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

a. 5

b. 3

c. 6

d. 7

2 / 40

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

3 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

4 / 40

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

5 / 40

5.

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.

6 / 40

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

7 / 40

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

8 / 40

8.

 Select the correct example of complex datatype in Python

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

9 / 40

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

10 / 40

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

11 / 40

11.

What is the data type of print(type(0xFF))

12 / 40

12. Most recent major version of Python is Python 3

13 / 40

13.

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.

14 / 40

14. With the break statement we can stop the loop even if the while condition is true

15 / 40

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

16 / 40

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

17 / 40

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

18 / 40

18. An example of an illegal character is a double quote inside a string that is surrounded by double quotes

19 / 40

19. A variable name cannot start with a number

20 / 40

20.

What will be the output of below Python code?

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

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

21 / 40

21. Extension of all Python  Programme are .py

22 / 40

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

23 / 40

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

24 / 40

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

25 / 40

25. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

26 / 40

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

27 / 40

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

28 / 40

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

29 / 40

29.

Write the output of the following code :

str = "Welcome"str[2] = 'a'print(str)

a. Weacome

b. Error

c. aWelcome

d. Welcomea

30 / 40

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

31 / 40

31.

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

a. Define

b. DEF

c. def

d. Def

32 / 40

32. python has two primitive loop commands:

  • while loops
  • for loops

33 / 40

33.

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

a. [ ]

b. { }

c. ( )

d. None of the above

34 / 40

34.

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

35 / 40

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

36 / 40

36. When does the else statement written after loop executes?

a) When loop condition becomes false

b) When break statement is executed in the loop

c) else statement is always executed

d) None of the above

37 / 40

37.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

38 / 40

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

39 / 40

39. Python is an interpreted programming language

40 / 40

40.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

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.