[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. The for loop in Python is an _____________

a) Entry Controlled Loop

b) Exit Controlled Loop

c) Both of the above

d) None of the above

3 / 40

3.

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

a. True

b. False

4 / 40

4. Python relies on indentation?

5 / 40

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

6 / 40

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

7 / 40

7.

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

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

8 / 40

8.

What will be the output of above Python code?

str1="6/4"print("str1")

A. 1
B. 6/4
C. 1.5
D. str1

9 / 40

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

10 / 40

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

11 / 40

11. Which of the following character is used to give single-line comments in Python?
a) //
b) #
c) !
d) /*

12 / 40

12. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

13 / 40

13. You can also have an else without the elif

14 / 40

14.

What will be the output of below Python code?

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

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

15 / 40

15.

 Select the correct example of complex datatype in Python

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

16 / 40

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

17 / 40

17.

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

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

18 / 40

18.

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

19 / 40

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

20 / 40

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

21 / 40

21.

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.

22 / 40

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

23 / 40

23.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

24 / 40

24. Python has various versions available

25 / 40

25. python file can also run on command line

26 / 40

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

27 / 40

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

28 / 40

28.

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

a. 2

b. 3

c. 5

d. Multiple times

29 / 40

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

30 / 40

30.

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

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

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

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

35 / 40

35.

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

a. Define

b. DEF

c. def

d. Def

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

39.

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

40 / 40

40.

Which is the correct operator for power(xy)?

  1. X^y
  2. X**y
  3. X^^y
  4. None 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.