[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. Variable names are case-sensitive

3 / 40

3.

 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.

4 / 40

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

5 / 40

5.

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

6 / 40

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

7 / 40

7.

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

a. Define

b. DEF

c. def

d. Def

8 / 40

8.

Which of the following precedence order is correct in Python?

  1. Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
  2. Multiplication, Division, Addition, Subtraction, Parentheses, Exponential
  3. Division, Multiplication, Addition, Subtraction, Parentheses, Exponential
  4. Exponential, Parentheses, Multiplication, Division, Addition, Subtraction

9 / 40

9. Python has various versions available

10 / 40

10. A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).

11 / 40

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

12 / 40

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

13 / 40

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

14 / 40

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

15 / 40

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

16 / 40

16. Comments starts with a #

17 / 40

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

18 / 40

18. Most recent major version of Python is Python 3

19 / 40

19.

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

20 / 40

20. You can also have an else without the elif

21 / 40

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

22 / 40

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

23 / 40

23. Variables that are created outside of a function

24 / 40

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

a. 5

b. 3

c. 6

d. 7

25 / 40

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

 

26 / 40

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

27 / 40

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

28 / 40

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

29 / 40

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

30 / 40

30. Python relies on indentation?

31 / 40

31. With the break statement we can stop the loop even if the while condition is true

32 / 40

32. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

33 / 40

33. Python can be install on both  Linux and  Windows

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

38. Python  was created by Guido van Rossum, and released in 1999.

39 / 40

39.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

40 / 40

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

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.