[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

Which of the following creates a tuple?

A. tuple1=(“a”,”b”)
B. tuple1[2]=(“a”,”b”)
C. tuple1=(5)*2
D. None of the above

2 / 40

2. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

3 / 40

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

4 / 40

4.

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

5 / 40

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

6 / 40

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

7 / 40

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

8 / 40

8. Variables that are created outside of a function

9 / 40

9. python file can also run on command line

10 / 40

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

11 / 40

11. Which of the following is the use of function in python?
a) Functions are reusable pieces of programs
b) Functions don’t provide better modularity for your application
c) you can’t also create your own functions
d) All of the mentioned

12 / 40

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

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. What is the index value of ‘i’ in string “Learning”

a. 5

b. 3

c. 6

d. 7

16 / 40

16.

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

a. [ ]

b. { }

c. ( )

d. None of the above

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.

What is the data type of print(type(10))

19 / 40

19. Find and write the output of the following python code:

x = “abcdef”

i = “a”

while i in x:

print(i, end = ” “)

a) a

b) a a a a a a

c) a a a a a a … infinite times

d) Code will generate error

20 / 40

20.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

21 / 40

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

22 / 40

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

23 / 40

23. The format() method takes the passed arguments

24 / 40

24. A variable name cannot start with a number

25 / 40

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

26 / 40

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

27 / 40

27. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

28 / 40

28.

 What is output of: 35 == 35.0

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

29 / 40

29.

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.

30 / 40

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

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

34. Strings in python are surrounded by either single quotation marks, or double quotation marks

35 / 40

35. Bitwise operators are used to compare (binary) numbers

36 / 40

36. You can also have an else without the elif

37 / 40

37. Who developed Python Programming Language?

38 / 40

38. Python can be install on both  Linux and  Windows

39 / 40

39.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

40 / 40

40.

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

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.