[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. The length of an array is always one more than the highest array index.

2 / 40

2. What is the index value of ‘i’ in string “Learning”

a. 5

b. 3

c. 6

d. 7

3 / 40

3. Comments starts with a #

4 / 40

4. Python relies on indentation?

5 / 40

5. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

6 / 40

6.

 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.

7 / 40

7. Python can be treated in a procedural way, an object-oriented way or a functional way.

8 / 40

8.

What is the value of the expression 100 / 25?

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

9 / 40

9.

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

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

10 / 40

10. 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”

11 / 40

11.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

12 / 40

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

13 / 40

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

14 / 40

14.

Which of the following is not a keyword in Python language?

  1. val
  2. raise
  3. try
  4. with

15 / 40

15. A variable name can only contain alpha-numeric characters and
underscores

16 / 40

16. During Installation Make sure to select both the checkboxes at the bottom .

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. Variables that are created outside of a function

19 / 40

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

20 / 40

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

21 / 40

21.

How to copy one list to another in python?

A. l1[] = l2[]
B. l1[] = l2
C. l1[] = l2[:]
D. l1 = l2

22 / 40

22.

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

a. Define

b. DEF

c. def

d. Def

23 / 40

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

24 / 40

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

25 / 40

25. break in Python is used ______________

a) To restart a loop

b) Terminate a loop

c) To jump in between the loop

d) None of the above

26 / 40

26. You have to use the same number of spaces in the same block of code, otherwise Python will give you an error

27 / 40

27.

 ____________________ 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

28 / 40

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

29 / 40

29. Extension of all Python  Programme are .py

30 / 40

30. + operator is used  to get output of multiple variables

31 / 40

31.

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

32 / 40

32.

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

a. True

b. False

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

36. python has two primitive loop commands:

  • while loops
  • for loops

37 / 40

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

38 / 40

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

39 / 40

39. Python is an interpreted programming language

40 / 40

40.

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

a. 2

b. 3

c. 5

d. Multiple times

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.