[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3. You have to use the same number of spaces in the same block of code, otherwise Python will give you an error

4 / 40

4.

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

a. 2

b. 3

c. 5

d. Multiple times

5 / 40

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

6 / 40

6. Strings in python are surrounded by either single quotation marks, or double quotation marks

7 / 40

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

8 / 40

8. You can also use the remove() method to remove an element from the array

9 / 40

9.

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

a. True

b. False

10 / 40

10.

What will be the output of below Python code?

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

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

11 / 40

11. Python is an interpreted programming language

12 / 40

12. Which of the following is used to define a block of code in Python language?
a) Indentation
b) Key
c) Brackets
d) All of the mentioned

13 / 40

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

14 / 40

14. Comments starts with a #

15 / 40

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

16 / 40

16. Who developed Python Programming Language?

17 / 40

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

18 / 40

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

19 / 40

19. Which term describes a loop that continues repeating without a terminating (ending) condition?

a) Infinite Loop

b) Conditional Loop

c) Unlimited Loop

d) Sequence Loop

20 / 40

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

21 / 40

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

22 / 40

22.

How to copy one list to another in python?

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

23 / 40

23. Snake Case
Each word is separated by an underscore character:

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

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

28 / 40

28.

Which function overloads the >> operator?

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

29 / 40

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

30 / 40

30.

What is the value of the expression 100 / 25?

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

31 / 40

31. Variable names are case-sensitive

32 / 40

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

33 / 40

33. Arrays are used to store multiple values in one single variable.

34 / 40

34.

The most important object defined in NumPy is an N-dimensional array type called?

A. ndarray
B. narray
C. nd_array
D. darray

35 / 40

35.

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

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

36 / 40

36. You can use three double quotes only:

a = “””Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.”””
print(a)

37 / 40

37.

Which is the correct operator for power(xy)?

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

38 / 40

38.

Which of the following is not a keyword in Python language?

  1. val
  2. raise
  3. try
  4. with

39 / 40

39. Python has various versions available

40 / 40

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

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.