[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3.

Which is the correct operator for power(xy)?

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

4 / 40

4.

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

a. Define

b. DEF

c. def

d. Def

5 / 40

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

6 / 40

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

7 / 40

7.

What do we use to define a block of code in Python language?

  1. Key
  2. Brackets
  3. Indentation
  4. None of these

8 / 40

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

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

12.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

13 / 40

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

14 / 40

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

15 / 40

15. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

16 / 40

16. Variables that are created outside of a function

17 / 40

17. Suppose t = (1, 2, 4, 3), which of the following is incorrect?
a) print(t[3])
b) t[3] = 45
c) print(max(t))
d) print(len(t))

18 / 40

18. You can also have an else without the elif

19 / 40

19.

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

a. [ ]

b. { }

c. ( )

d. None of the above

20 / 40

20. Most recent major version of Python is Python 3

21 / 40

21. Variable names are case-sensitive

22 / 40

22. Is Python code compiled or interpreted?
a) Python code is both compiled and interpreted
b) Python code is neither compiled nor interpreted
c) Python code is only compiled
d) Python code is only interpreted

23 / 40

23.

Which one of the following is the correct extension of the Python file?

  1. .py
  2. .python
  3. .p
  4. None of these

24 / 40

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

25 / 40

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

26 / 40

26. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

27 / 40

27.

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

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

28 / 40

28.

What will be the output of below Python code?

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

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

29 / 40

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

30 / 40

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

31 / 40

31.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

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

34 / 40

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

35 / 40

35. python file can also run on command line

36 / 40

36. Python can be install on both  Linux and  Windows

37 / 40

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

38 / 40

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

39 / 40

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

40 / 40

40.

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

a. True

b. False

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.