[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Python is an interpreted programming language

2 / 40

2.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

3 / 40

3.

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.

4 / 40

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

 

5 / 40

5.

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

a. 2

b. 3

c. 5

d. Multiple times

6 / 40

6.

What is the value of the expression 100 / 25?

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

7 / 40

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

8 / 40

8. Pascal Case
Each word starts with a capital letter:

9 / 40

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

10 / 40

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

11 / 40

11. Variable names are case-sensitive

12 / 40

12. Comments can be used to explain Python code.

13 / 40

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

14 / 40

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

15 / 40

15.

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.

16 / 40

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

17 / 40

17. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

18 / 40

18.

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

19 / 40

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

20 / 40

20.

Which of the following statement will execute in last?

def s(n1): #Statement 1      print(n1) #Statement 2n2=4 #Statement 3s(n2) #Statement 4

a. Statement 1

b. Statement 2

c. Statement 3

d. Statement 4

21 / 40

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

22 / 40

22. What keyword would you use to add an alternative condition to an if statement?

a) else if
b) elseif
c) elif
d) None of the above

23 / 40

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

24 / 40

24.

What is the data type of print(type(0xFF))

25 / 40

25.

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.

26 / 40

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

27 / 40

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

28 / 40

28.

 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.

29 / 40

29. Variables that are created outside of a function

30 / 40

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

31 / 40

31.

 What is output of: 35 == 35.0

  1. False
  2. True
  3. 33
  4. None of the above

32 / 40

32. Python is a  high-level programming language.

33 / 40

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

34 / 40

34.

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.

35 / 40

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

36 / 40

36.

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

37 / 40

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

38 / 40

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

39 / 40

39. The format() method takes the passed arguments

40 / 40

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

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.