[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. A variable name cannot start with a number

2 / 40

2. The for loop does not require an indexing variable to set beforehand

3 / 40

3. Python has a set of built-in methods that you can use on lists/arrays

4 / 40

4.

How to copy one list to another in python?

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

5 / 40

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

6 / 40

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

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

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

11 / 40

11. Comparison operators are not  used to compare two values

12 / 40

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

13 / 40

13. Python can be install on both  Linux and  Windows

14 / 40

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

15 / 40

15. Comments can be used to explain Python code.

16 / 40

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

17 / 40

17. To write and execute code in python, we first need to install Python on our system

18 / 40

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

19 / 40

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

20 / 40

20.

 Select the correct example of complex datatype in Python

  1. 3 + 2j
  2. -100j
  3. 5j
  4. All of the above are correct

21 / 40

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

22 / 40

22.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

23 / 40

23.

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

24 / 40

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

25 / 40

25.

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.

26 / 40

26. Variable names are case-sensitive

27 / 40

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

28 / 40

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

29 / 40

29. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

30 / 40

30.

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

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

31 / 40

31.

Which function overloads the >> operator?

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

32 / 40

32. Who developed Python Programming Language?

33 / 40

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

34 / 40

34.

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

a. [ ]

b. { }

c. ( )

d. None of the above

35 / 40

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

36 / 40

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

37 / 40

37. python has two primitive loop commands:

  • while loops
  • for loops

38 / 40

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

39 / 40

39.

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

40 / 40

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

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.