[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. The for loop does not require an indexing variable to set beforehand

3 / 40

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

4 / 40

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

5 / 40

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

6 / 40

6. Variable names are case-sensitive

7 / 40

7.

What will be the output of below Python code?

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

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

8 / 40

8. Python can be install on both  Linux and  Windows

9 / 40

9.

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

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

13.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

14 / 40

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

15 / 40

15.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

16 / 40

16.

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.

17 / 40

17.

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

18 / 40

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

19 / 40

19. Find the output of the given Python program?

a, b, c = 1, 3, 5if a > 0:  if b < 2:    print("Hi")  elif c > 3:    print("Hello")else:  print("Know Program")

a) Hi
b) Hello
c) Know Program
d) Compiled Successfully, No Output.

20 / 40

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

21 / 40

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

22 / 40

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

23 / 40

23.

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

24 / 40

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

25 / 40

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

26 / 40

26.

 ____________________ 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

27 / 40

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

28 / 40

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

29 / 40

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

30 / 40

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

31 / 40

31.

What is the value of the expression 100 / 25?

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

32 / 40

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

33 / 40

33.

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.

34 / 40

34. Extension of all Python  Programme are .py

35 / 40

35.

 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.

36 / 40

36.

How to copy one list to another in python?

A. l1[] = l2[]
B. l1[] = l2
C. l1[] = l2[:]
D. l1 = l2

37 / 40

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

38 / 40

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

39 / 40

39. Python has various versions available

40 / 40

40. Python is an interpreted 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.