[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

What is the value of the expression 100 / 25?

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

2 / 40

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

3 / 40

3. Snake Case
Each word is separated by an underscore character:

4 / 40

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

5 / 40

5. Can we write if/else into one line in python?

a) Yes
b) No
c) if/else not used in python
d) None of the above

6 / 40

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

7 / 40

7. A variable name cannot start with a number

8 / 40

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

9 / 40

9. python file can also run on command line

10 / 40

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

11 / 40

11. Most recent major version of Python is Python 3

12 / 40

12. Python is an interpreted programming language

13 / 40

13.

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

a. 2

b. 3

c. 5

d. Multiple times

14 / 40

14.

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

a. [ ]

b. { }

c. ( )

d. None of the above

15 / 40

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

16 / 40

16.

Which is the correct operator for power(xy)?

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

17 / 40

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

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

21.

 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.

22 / 40

22.

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

a. True

b. False

23 / 40

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

24 / 40

24. Comments starts with a #

25 / 40

25.

 ____________________ 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

26 / 40

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

27 / 40

27.

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

28 / 40

28.

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

29 / 40

29. Which term describes a loop that continues repeating without a terminating (ending) condition?

a) Infinite Loop

b) Conditional Loop

c) Unlimited Loop

d) Sequence Loop

30 / 40

30. Indentation refers to the spaces at the beginning of a code line.

31 / 40

31.

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

32 / 40

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

33 / 40

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

34 / 40

34.

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

35 / 40

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

36 / 40

36. Extension of all Python  Programme are .py

37 / 40

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

38 / 40

38. What will be the output of the following Python code?

  1. d = {"john":40, "peter":45}
  2. d["john"]

a) 40
b) 45
c) “john”
d) “peter”

39 / 40

39. You can also have an else without the elif

40 / 40

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

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.