[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3.

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

a. 2

b. 3

c. 5

d. Multiple times

4 / 40

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

a. 5

b. 3

c. 6

d. 7

5 / 40

5. Variables that are created outside of a function

6 / 40

6.

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

7 / 40

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

8 / 40

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

9 / 40

9. Comments starts with a #

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

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

14 / 40

14.

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

a. True

b. False

15 / 40

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

16 / 40

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

17 / 40

17.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

18 / 40

18. The format() method takes the passed arguments

19 / 40

19. Which of the following is the correct extension of the Python file?

20 / 40

20.

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

21 / 40

21. An array can hold many values under a single name

22 / 40

22. A variable name cannot start with a number

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. Python can connect to database systems.

25 / 40

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

26 / 40

26.

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

27 / 40

27. Official site of python is www.python.org

28 / 40

28. Python relies on indentation?

29 / 40

29.

 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.

30 / 40

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

31 / 40

31.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

32 / 40

32. Python is an interpreted programming language

33 / 40

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

34 / 40

34.

What will the below Python code will return?

If str1="save paper,save plants"str1.find("save")

A. It returns the first index position of the first occurance of “save” in the given string str1.
B. It returns the last index position of the last occurance of “save” in the given string str1.
C. It returns the last index position of the first occurance of “save” in the given string str1.
D. It returns the first index position of the first occurance of “save” in the given string str1.

35 / 40

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

36 / 40

36.

 ____________________ 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

37 / 40

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

38 / 40

38.

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.

39 / 40

39. Python can be install on both  Linux and  Windows

40 / 40

40. Python is a  high-level programming language.

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.