[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Comments can be used to explain Python code.

2 / 40

2.

What is the data type of print(type(10))

3 / 40

3.

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

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.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

6 / 40

6.

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

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

7 / 40

7.

What is the value of the expression 100 / 25?

  1. 4
  2. 4.0
  3. 0
  4. 25

8 / 40

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

9 / 40

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

10 / 40

10.

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.

11 / 40

11.

Which function overloads the >> operator?

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

12 / 40

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

13 / 40

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

14 / 40

14.

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

15 / 40

15.

In Python, a variable may be assigned a value of one type, and then later assigned a value of a different type:

  1. False
  2. True

16 / 40

16. The format() method takes the passed arguments

17 / 40

17.

Which statement is correct?

A. List is immutable && Tuple is mutable
B. List is mutable && Tuple is immutable
C. Both are Mutable.
D. Both are Immutable

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

21. Python relies on indentation?

22 / 40

22.

 ____________________ 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

23 / 40

23.

Which one of the following is the correct extension of the Python file?

  1. .py
  2. .python
  3. .p
  4. None of these

24 / 40

24.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

25 / 40

25. Which keyword is used for function?
a) Fun
b) Define
c) Def
d) Function

26 / 40

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

27 / 40

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

28 / 40

28. python file can also run on command line

29 / 40

29. Find and write the output of the following python code:

x = “abcdef”

i = “a”

while i in x:

print(i, end = ” “)

a) a

b) a a a a a a

c) a a a a a a … infinite times

d) Code will generate error

30 / 40

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

31 / 40

31.

Which of the following statements assigns the value 25 to the variable x in Python:

  1. x ← 25
  2. x = 25
  3. x := 25
  4. int x = 25
  5. x << 25

32 / 40

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

33 / 40

33. Python  was created by Guido van Rossum, and released in 1999.

34 / 40

34.

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

a. [ ]

b. { }

c. ( )

d. None of the above

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

38.

 Select the correct example of complex datatype in Python

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

39 / 40

39. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

40 / 40

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

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.