[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

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

4 / 40

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

5 / 40

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

6 / 40

6. You can also use the remove() method to remove an element from the array

7 / 40

7.

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

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. Python will give you an error if you skip the indentation

10 / 40

10.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

11 / 40

11.

 Select the correct example of complex datatype in Python

  1. 3 + 2j
  2. -100j
  3. 5j
  4. All of the above are correct

12 / 40

12.

Which of the following is not a keyword in Python language?

  1. val
  2. raise
  3. try
  4. with

13 / 40

13.

What will be the output of above Python code?

str1="6/4"print("str1")

A. 1
B. 6/4
C. 1.5
D. str1

14 / 40

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

15 / 40

15. Comments starts with a #

16 / 40

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

17 / 40

17.

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

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. Python can be used to handle big data and perform complex mathematics.

20 / 40

20. When does the else statement written after loop executes?

a) When loop condition becomes false

b) When break statement is executed in the loop

c) else statement is always executed

d) None of the above

21 / 40

21. Is there any comments in  following codes

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

 

22 / 40

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

23 / 40

23.

What will be the output of below Python code?

str1="poWer"str1.upper()print(str1)

A. POWER
B. Power
C. power
D. poWer

24 / 40

24.

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

25 / 40

25.

 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.

26 / 40

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

27 / 40

27.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

28 / 40

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

29 / 40

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

30 / 40

30. Python can be install on both  Linux and  Windows

31 / 40

31. What will be the output of the following Python code?

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

a) 1 2
b) 1 2 3
c) error
d) none of the mentioned

32 / 40

32. python has two primitive loop commands:

  • while loops
  • for loops

33 / 40

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

34 / 40

34. Identity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with the same memory location

35 / 40

35. Extension of all Python  Programme are .py

36 / 40

36.

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.

37 / 40

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

38 / 40

38. With the for loop we can execute a set of statements

39 / 40

39.

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

a. [ ]

b. { }

c. ( )

d. None of the above

40 / 40

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

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.