[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. Most recent major version of Python is Python 3

3 / 40

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

4 / 40

4.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

5 / 40

5.

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.

6 / 40

6. break in Python is used ______________

a) To restart a loop

b) Terminate a loop

c) To jump in between the loop

d) None of the above

7 / 40

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

8 / 40

8. A variable name can only contain alpha-numeric characters and
underscores

9 / 40

9.

What will be the output of above Python code?

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

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

10 / 40

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

11 / 40

11. Extension of all Python  Programme are .py

12 / 40

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

13 / 40

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

14 / 40

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

15 / 40

15. A variable name must start with a letter or the underscore character

16 / 40

16. Comments starts with a #

17 / 40

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

18 / 40

18. Comparison operators are not  used to compare two values

19 / 40

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

20 / 40

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

21 / 40

21. The elif keyword is pythons way of saying “if the previous conditions were not true, then try this condition”.

22 / 40

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

23 / 40

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

24 / 40

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

25 / 40

25. Python has various versions available

26 / 40

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

27 / 40

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

28 / 40

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

29 / 40

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

30 / 40

30.

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

a. Define

b. DEF

c. def

d. Def

31 / 40

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

a. 5

b. 3

c. 6

d. 7

32 / 40

32.

What is the value of the expression 100 / 25?

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

33 / 40

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

34 / 40

34. + operator is used  to get output of multiple variables

35 / 40

35. The len() method to return the length of an array

36 / 40

36. Comments can’t be used to prevent execution when testing code.

37 / 40

37.

Which of the following statements assigns the value 25 to the variable x in Python:

  1. x ← 25
  2. x = 25
  3. x := 25
  4. int x = 25
  5. x << 25

38 / 40

38. Can we write if/else into one line in python?

a) Yes
b) No
c) if/else not used in python
d) None of the above

39 / 40

39.

Which function overloads the >> operator?

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

40 / 40

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

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.