[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

 ____________________ 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

2 / 40

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

3 / 40

3. Python can be treated in a procedural way, an object-oriented way or a functional way.

4 / 40

4.

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

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. The else keyword catches anything which isn’t caught by the preceding conditions.

7 / 40

7.

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

8 / 40

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

9 / 40

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

10 / 40

10. What will be the output of the following Python code?

  1. d = {"john":40, "peter":45}
  2. d["john"]

a) 40
b) 45
c) “john”
d) “peter”

11 / 40

11. Most recent major version of Python is Python 3

12 / 40

12. What is the output of the given below program?

if 1 + 3 == 7:    print("Hello")else:    print("Know Program")

a) Hello
b) Know Program
c) Compiled Successfully, No Output.
d) Error

13 / 40

13. You can use the append() method to add an element to an array

14 / 40

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

15 / 40

15.

 What is output of: 35 == 35.0

  1. False
  2. True
  3. 33
  4. None of the above

16 / 40

16. What does the following code print?

x = -10if x < 0:    print("The negative number ",  x, " is not valid here.")print("This is always printed")
a.This is always printedb.The negative number -10 is not valid hereThis is always printedc.The negative number -10 is not valid here

17 / 40

17. print() function is often used to output variables.

18 / 40

18.

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

19 / 40

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

20 / 40

20. What keyword would you use to add an alternative condition to an if statement?

a) else if
b) elseif
c) elif
d) None of the above

21 / 40

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

22 / 40

22. An array is a special variable, which can hold more than one value at a time

23 / 40

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

24 / 40

24.

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

a. Define

b. DEF

c. def

d. Def

25 / 40

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

26 / 40

26.

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

27 / 40

27. Variable names are case-sensitive

28 / 40

28.

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.

29 / 40

29.

Which function overloads the >> operator?

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

30 / 40

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

31 / 40

31. Is there any comments in  following codes

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

 

32 / 40

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

33 / 40

33.

Which of the following precedence order is correct in Python?

  1. Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
  2. Multiplication, Division, Addition, Subtraction, Parentheses, Exponential
  3. Division, Multiplication, Addition, Subtraction, Parentheses, Exponential
  4. Exponential, Parentheses, Multiplication, Division, Addition, Subtraction

34 / 40

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

35 / 40

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

36 / 40

36. Comments starts with a #

37 / 40

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

38 / 40

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

39 / 40

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

40 / 40

40.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

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.