[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

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

2 / 40

2.

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.

3 / 40

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

4 / 40

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

5 / 40

5. Python relies on indentation?

6 / 40

6. The len() method to return the length of an array

7 / 40

7. With the break statement we can stop the loop before it has looped through all the items

8 / 40

8.

 What is output of: 35 == 35.0

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

9 / 40

9.

How to copy one list to another in python?

A. l1[] = l2[]
B. l1[] = l2
C. l1[] = l2[:]
D. l1 = l2

10 / 40

10. Python has a set of built-in methods that you can use on lists/arrays

11 / 40

11. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

12 / 40

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

13 / 40

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

14 / 40

14.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

15 / 40

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

16 / 40

16. break in Python is used ______________

a) To restart a loop

b) Terminate a loop

c) To jump in between the loop

d) None of the above

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. Is there any comments in  following codes

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

 

19 / 40

19.

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

20 / 40

20.

Which is the correct operator for power(xy)?

  1. X^y
  2. X**y
  3. X^^y
  4. None of the mentioned

21 / 40

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

22 / 40

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

23 / 40

23.

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

24 / 40

24. You can have if statements inside if statements, this is called nested if statements.

25 / 40

25. Find the output of the given Python program?

a, b, c = 1, 3, 5if a > 0:  if b < 2:    print("Hi")  elif c > 3:    print("Hello")else:  print("Know Program")

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

26 / 40

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

27 / 40

27.

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

28 / 40

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

29 / 40

29. Comparison operators are not  used to compare two values

30 / 40

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

31 / 40

31. Which of the following is a Python tuple?
a) [1, 2, 3]
b) (1, 2, 3)
c) {1, 2, 3}
d) {}

32 / 40

32.

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

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

33 / 40

33.

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

a. Define

b. DEF

c. def

d. Def

34 / 40

34.

 ____________________ 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

35 / 40

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

36 / 40

36. Comments starts with a #

37 / 40

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

38 / 40

38.

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

39 / 40

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

40 / 40

40. Find the output of the given Python program?

a = 25if a < 15:    print("Hi")if a <= 30:    print("Hello")else:    print("Know Program")

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

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.