[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. Python has various versions available

3 / 40

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

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

a) Hi
b) Know Program

c)
Hi
Hello

d)
Know Program
Hello

4 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

5 / 40

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

6 / 40

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

7 / 40

7.

 ____________________ 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

8 / 40

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

9 / 40

9.

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

10 / 40

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

11 / 40

11.

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

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

12 / 40

12.

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

13 / 40

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

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.

What will be the output of below Python code?

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

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

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

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

21. Python relies on indentation?

22 / 40

22.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

23 / 40

23. You can also have an else without the elif

24 / 40

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

25 / 40

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

26 / 40

26.

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

a. True

b. False

27 / 40

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

28 / 40

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

29 / 40

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

30 / 40

30. Pip is  not a powerful package management system for Python software packages

31 / 40

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

32 / 40

32. Comments starts with a #

33 / 40

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

34 / 40

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

35 / 40

35.

Which of the following is False?

A. String is immutable.
B. capitalize() function in string is used to return a string by converting the whole given string into uppercase.
C. lower() function in string is used to return a string by converting the whole given string into lowercase.
D. None of these.

36 / 40

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

37 / 40

37. The else keyword catches anything which isn’t caught by the preceding conditions.

38 / 40

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

39 / 40

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

40 / 40

40. Arrays are used to store multiple values in one single variable.

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.