[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

Python considered the character enclosed in triple quotes as String.(T/F)

a. True

b. False

3 / 40

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

4 / 40

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

5 / 40

5. Python relies on indentation?

6 / 40

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

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

9 / 40

9.

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

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

12 / 40

12. The format() method takes the passed arguments

13 / 40

13. An example of an illegal character is a double quote inside a string that is surrounded by double quotes

14 / 40

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

15 / 40

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

16 / 40

16. You can also have an else without the elif

17 / 40

17.

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

18 / 40

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

19 / 40

19. What does the following code print?

x = -10if x < 0:    print("The negative number ",  x, " is not valid here.")print("This is always printed")
a.This is always printedb.The negative number -10 is not valid hereThis is always printedc.The negative number -10 is not valid here

20 / 40

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

21 / 40

21.

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

a. [ ]

b. { }

c. ( )

d. None of the above

22 / 40

22. Python can be install on both  Linux and  Windows

23 / 40

23. Python allows you to extract the values into variables.

24 / 40

24. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

25 / 40

25. Camel Case
Each word, except the first, starts with a capital letter:

26 / 40

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

27 / 40

27.

 What is output of: 35 == 35.0

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

28 / 40

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

29 / 40

29. Extension of all Python  Programme are .py

30 / 40

30. Python has various versions available

31 / 40

31.

In the Python statement x = a + 5 – b:

a and b are ________a + 5 - b is ________
  1. terms, a group
  2. operators, a statement
  3. operands, an expression
  4. operands, an equation

32 / 40

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

33 / 40

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

34 / 40

34. Which keyword is used for function?
a) Fun
b) Define
c) Def
d) Function

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

38. You can use the append() method to add an element to an array

39 / 40

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

40 / 40

40. Is there any comments in  following codes

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

 

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.