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

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

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

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

4 / 40

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

5 / 40

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

6 / 40

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

7 / 40

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

8 / 40

8. Which of the following is the correct extension of the Python file?

9 / 40

9.

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

10 / 40

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

11 / 40

11. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

12 / 40

12. A variable name cannot start with a number

13 / 40

13.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

14 / 40

14.

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

15 / 40

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

16 / 40

16. What does the following code print?

x = -10if x < 0:    print("The negative number ",  x, " is not valid here.")print("This is always printed")
a.This is always printedb.The negative number -10 is not valid hereThis is always printedc.The negative number -10 is not valid here

17 / 40

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

18 / 40

18. Comments can be used to explain Python code.

19 / 40

19.

What is the value of the expression 100 / 25?

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

20 / 40

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

21 / 40

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

22 / 40

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

23 / 40

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

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

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

28 / 40

28. Python can be used to handle big data and perform complex mathematics.

29 / 40

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

30 / 40

30. Find the output of the following program segments:

for i in range(20,30,2):

print(i)

a) 20 22 24 26 28

b) 20

22

24

26

28

c) 20 22 24 26 28 30

d) 20

22

24

26

28

30

31 / 40

31. We can combine strings and numbers by using the format() method

32 / 40

32.

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

33 / 40

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

34 / 40

34.

 Which of the following statement is False?

  1. Variable names can be arbitrarily long.
  2. They can contain both letters and numbers.
  3. Variable name can begin with underscore.
  4. Variable name can begin with number.

35 / 40

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

36 / 40

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

37 / 40

37. Python is an interpreted programming language

38 / 40

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

39 / 40

39. Camel Case
Each word, except the first, starts with a capital letter:

40 / 40

40. Extension of all Python  Programme are .py

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.