[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3. You can return a range of characters by using the slice syntax

4 / 40

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

5 / 40

5. Python can connect to database systems.

6 / 40

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

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

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

11 / 40

11.

Which is the correct operator for power(xy)?

  1. X^y
  2. X**y
  3. X^^y
  4. None of the mentioned

12 / 40

12.

 ____________________ 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

13 / 40

13.

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

14 / 40

14. Comments can be used to explain Python code.

15 / 40

15. Operators are used to perform operations on variables and values

16 / 40

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

17 / 40

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

18 / 40

18.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

19 / 40

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

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. Python can be install on both  Linux and  Windows

22 / 40

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

23 / 40

23.

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

24 / 40

24.

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.

25 / 40

25. Find the output of the given Python program?

a = 25if a < 15:    print("Hi")if a <= 30:    print("Hello")else:    print("Know Program")

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

26 / 40

26.

Which function overloads the >> operator?

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

27 / 40

27.

What do we use to define a block of code in Python language?

  1. Key
  2. Brackets
  3. Indentation
  4. None of these

28 / 40

28. What is the index value of ‘i’ in string “Learning”

a. 5

b. 3

c. 6

d. 7

29 / 40

29. An array is a special variable, which can hold more than one value at a time

30 / 40

30. Python relies on indentation?

31 / 40

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

32 / 40

32.

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.

33 / 40

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

34 / 40

34.

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

35 / 40

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

36 / 40

36. Variables that are created outside of a function

37 / 40

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

38 / 40

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

39 / 40

39. Most recent major version of Python is Python 3

40 / 40

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

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.