[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. An example of an illegal character is a double quote inside a string that is surrounded by double quotes

2 / 40

2.

What will be the output of above Python code?

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

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

3 / 40

3. The list’s remove() method only removes the first occurrence of the specified value.

4 / 40

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

5 / 40

5. Python can be install on both  Linux and  Windows

6 / 40

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

7 / 40

7. Python is an interpreted programming language

8 / 40

8.

The function can be called in the program by writing function name followed by ____

a. [ ]

b. { }

c. ( )

d. None of the above

9 / 40

9.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

10 / 40

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

11 / 40

11. Comments can be used to explain Python code.

12 / 40

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

13 / 40

13.

Which of the following statement will execute in last?

def s(n1): #Statement 1      print(n1) #Statement 2n2=4 #Statement 3s(n2) #Statement 4

a. Statement 1

b. Statement 2

c. Statement 3

d. Statement 4

14 / 40

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

15 / 40

15.

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

16 / 40

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

17 / 40

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

18 / 40

18.

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

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

19 / 40

19.

What is the value of the expression 100 / 25?

  1. 4
  2. 4.0
  3. 0
  4. 25

20 / 40

20.

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.

21 / 40

21. A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).

22 / 40

22.

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

23 / 40

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

24 / 40

24.

What will be the output of below Python code?

str1="poWer"str1.upper()print(str1)

A. POWER
B. Power
C. power
D. poWer

25 / 40

25.

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

a. True

b. False

26 / 40

26. Most recent major version of Python is Python 3

27 / 40

27. Extension of all Python  Programme are .py

28 / 40

28.

What will be the output of below Python code?

tupl=([2,3],"abc",0,9)tupl[0][1]=1print(tupl)A. ([2,3],"abc",0,9)B. ([1,3],"abc",0,9)C. ([2,1],"abc",0,9)D. Error

29 / 40

29. Comments starts with a #

30 / 40

30. Python can connect to database systems.

31 / 40

31. Python is a  high-level programming language.

32 / 40

32.

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

33 / 40

33. Which of the following is used to define a block of code in Python language?
a) Indentation
b) Key
c) Brackets
d) All of the mentioned

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

39.

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.

40 / 40

40. Python will give you an error if you skip the indentation

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.