[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Python is an interpreted programming language

2 / 40

2.

 ____________________ 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

3 / 40

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

4 / 40

4.

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

5 / 40

5.

Choose the correct option with respect to Python.

A. Both tuples and lists are immutable.
B. Tuples are immutable while lists are mutable.
C. Both tuples and lists are mutable.
D. Tuples are mutable while lists are immutable.

6 / 40

6.

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

a. Define

b. DEF

c. def

d. Def

7 / 40

7. Python allows you to extract the values into variables.

8 / 40

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

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

13. The elif keyword is pythons way of saying “if the previous conditions were not true, then try this condition”.

14 / 40

14.

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.

15 / 40

15.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

16 / 40

16. python file can also run on command line

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.

What will be the output of below Python code?

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

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

19 / 40

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

20 / 40

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

21 / 40

21.

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

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

22 / 40

22.

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

23 / 40

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

24 / 40

24.

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.

25 / 40

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

26 / 40

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

27 / 40

27.

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

a. 2

b. 3

c. 5

d. Multiple times

28 / 40

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

29 / 40

29. Is there any comments in  following codes

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

 

30 / 40

30.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

34. Python can connect to database systems.

35 / 40

35. python has two primitive loop commands:

  • while loops
  • for loops

36 / 40

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

37 / 40

37.

What will be the output of above Python code?

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

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

38 / 40

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

39 / 40

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

40 / 40

40. You can also have an else without the elif

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.