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

2 / 40

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

3 / 40

3.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

4 / 40

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

5 / 40

5. With the break statement we can stop the loop before it has looped through all the items

6 / 40

6.

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

7 / 40

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

8 / 40

8. Python is an interpreted programming language

9 / 40

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

10 / 40

10.

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

11 / 40

11.

What will be the output of below Python code?

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

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

12 / 40

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

13 / 40

13. Pip is  not a powerful package management system for Python software packages

14 / 40

14.

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.

15 / 40

15.

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

16 / 40

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

17 / 40

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

18 / 40

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

19 / 40

19. Python can be install on both  Linux and  Windows

20 / 40

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

21 / 40

21. A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).

22 / 40

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

23 / 40

23. A variable name cannot start with a number

24 / 40

24. You can use the pop() method to remove an element from the array

25 / 40

25.

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

a. Define

b. DEF

c. def

d. Def

26 / 40

26.

Which one of the following is the correct extension of the Python file?

  1. .py
  2. .python
  3. .p
  4. None of these

27 / 40

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

28 / 40

28. Find the output of the following program segments:

for i in range(20,30,2):

print(i)

a) 20 22 24 26 28

b) 20

22

24

26

28

c) 20 22 24 26 28 30

d) 20

22

24

26

28

30

29 / 40

29.

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

a. 2

b. 3

c. 5

d. Multiple times

30 / 40

30. You can also have an else without the elif

31 / 40

31. Which of the following loop is not supported by the python programming language?

a) for loop

b) while loop

c) do…while loop

d) None of the above

32 / 40

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

33 / 40

33.

 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.

34 / 40

34.

Which function overloads the >> operator?

  1. more()
  2. gt()
  3. ge()
  4. None of the above

35 / 40

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

36 / 40

36.

What will be the output of below Python code?

tupl=([2,3],"abc",0,9)tupl[0][1]=1print(tupl)A. ([2,3],"abc",0,9)B. ([1,3],"abc",0,9)C. ([2,1],"abc",0,9)D. Error

37 / 40

37.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

38 / 40

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

39 / 40

39.

What will be the output of above Python code?

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

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

40 / 40

40. Comments can be used to explain Python code.

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.