[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. Find the output of the given Python program?

a, b, c = 1, 3, 5if a > 0:  if b < 2:    print("Hi")  elif c > 3:    print("Hello")else:  print("Know Program")

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

3 / 40

3.

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

4 / 40

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

5 / 40

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

6 / 40

6.

Which function overloads the >> operator?

  1. more()
  2. gt()
  3. ge()
  4. None of the above

7 / 40

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

8 / 40

8. Who developed Python Programming Language?

9 / 40

9.

Function defined to achieve some task as per the programmer’s requirement is called a ___________

a. user defined function

b. library function

c. built in functions

d. All of the above.

10 / 40

10.

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

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

11 / 40

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

12 / 40

12. Python can be install on both  Linux and  Windows

13 / 40

13. Find the output of the given Python program?

a = 25if a < 15:    print("Hi")if a <= 30:    print("Hello")else:    print("Know Program")

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

14 / 40

14.

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.

15 / 40

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

a. 5

b. 3

c. 6

d. 7

16 / 40

16. Comments can be used to explain Python code.

17 / 40

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

18 / 40

18. 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()

 

19 / 40

19. Variables that are created outside of a function

20 / 40

20. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

21 / 40

21.

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

22 / 40

22. print() function is often used to output variables.

23 / 40

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

24 / 40

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

25 / 40

25. Python relies on indentation?

26 / 40

26.

What is the value of the expression 100 / 25?

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

27 / 40

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

28 / 40

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

29 / 40

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

x = ['ab', 'cd']for i in x:    i.upper()print(x)

a) [‘ab’, ‘cd’]
b) [‘AB’, ‘CD’]
c) [None, None]
d) none of the mentioned

30 / 40

30.

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

a. [ ]

b. { }

c. ( )

d. None of the above

31 / 40

31. python file can also run on command line

32 / 40

32. Which of the following is used to define a block of code in Python language?
a) Indentation
b) Key
c) Brackets
d) All of the mentioned

33 / 40

33.

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

a. True

b. False

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

37. The len() method to return the length of an array

38 / 40

38.

How to copy one list to another in python?

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

39 / 40

39.

 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.

40 / 40

40. The for loop does not require an indexing variable to set beforehand

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.