[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

In the Python statement x = a + 5 – b:

a and b are ________a + 5 - b is ________
  1. terms, a group
  2. operators, a statement
  3. operands, an expression
  4. operands, an equation

2 / 40

2.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

3 / 40

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

4 / 40

4.

Which of the following is False?

A. String is immutable.
B. capitalize() function in string is used to return a string by converting the whole given string into uppercase.
C. lower() function in string is used to return a string by converting the whole given string into lowercase.
D. None of these.

5 / 40

5. Extension of all Python  Programme are .py

6 / 40

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

7 / 40

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

8 / 40

8. Python relies on indentation?

9 / 40

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

10 / 40

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

11 / 40

11.

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

a. Define

b. DEF

c. def

d. Def

12 / 40

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

13 / 40

13.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

14 / 40

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

15 / 40

15.

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

a. True

b. False

16 / 40

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

17 / 40

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

18 / 40

18.

Which is the correct operator for power(xy)?

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

19 / 40

19. All keywords in Python are in _________
a) Capitalized
b) lower case
c) UPPER CASE
d) None of the mentioned

20 / 40

20.

 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.

21 / 40

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

22 / 40

22. To write and execute code in python, we first need to install Python on our system.

23 / 40

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

24 / 40

24. To write and execute code in python, we first need to install Python on our system

25 / 40

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

26 / 40

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

27 / 40

27.

What is the value of the expression 100 / 25?

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

28 / 40

28.

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

29 / 40

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

30 / 40

30. What is the output of the given below program?

if 1 + 3 == 7:    print("Hello")else:    print("Know Program")

a) Hello
b) Know Program
c) Compiled Successfully, No Output.
d) Error

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

37.

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

38 / 40

38. X wants to allow the program to repeatedly ask the user to enter their Choice if it does not equal the Answer. Which loop option should X use?

a) while Choice == Answer:

Choice = input()

b) while Choice != Answer:

Choice = input()

c) while Answer != Choice:

Choice = input()

d) while Answer =! Choice:

Choice = input()

 

39 / 40

39. Python has various versions available

40 / 40

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

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.