[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

 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.

3 / 40

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

4 / 40

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

5 / 40

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

6 / 40

6. Python has various versions available

7 / 40

7. The else keyword catches anything which isn’t caught by the preceding conditions.

8 / 40

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

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

13. Variables that are created outside of a function

14 / 40

14. Which of the following character is used to give single-line comments in Python?
a) //
b) #
c) !
d) /*

15 / 40

15.

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

16 / 40

16.

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.

17 / 40

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

18 / 40

18.

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

a. Define

b. DEF

c. def

d. Def

19 / 40

19. Which keyword is used for function?
a) Fun
b) Define
c) Def
d) Function

20 / 40

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

21 / 40

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

22 / 40

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

23 / 40

23. Python can be install on both  Linux and  Windows

24 / 40

24.

Choose the correct option with respect to Python.

A. Both tuples and lists are immutable.
B. Tuples are immutable while lists are mutable.
C. Both tuples and lists are mutable.
D. Tuples are mutable while lists are immutable.

25 / 40

25.

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.

26 / 40

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

27 / 40

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

28 / 40

28. Variable names are case-sensitive

29 / 40

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

30 / 40

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

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

36. Comparison operators are not  used to compare two values

37 / 40

37.

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

a. True

b. False

38 / 40

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

39 / 40

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

40 / 40

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

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.