[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

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

2 / 40

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

3 / 40

3. Most recent major version of Python is Python 3

4 / 40

4.

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

a. [ ]

b. { }

c. ( )

d. None of the above

5 / 40

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

6 / 40

6.

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

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

7 / 40

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

8 / 40

8. Comments can be used to explain Python code.

9 / 40

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

10 / 40

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

11 / 40

11.

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.

12 / 40

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

13 / 40

13.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

14 / 40

14.

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.

15 / 40

15.

Which of the following statement will execute in last?

def s(n1): #Statement 1      print(n1) #Statement 2n2=4 #Statement 3s(n2) #Statement 4

a. Statement 1

b. Statement 2

c. Statement 3

d. Statement 4

16 / 40

16.

Which of the following precedence order is correct in Python?

  1. Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
  2. Multiplication, Division, Addition, Subtraction, Parentheses, Exponential
  3. Division, Multiplication, Addition, Subtraction, Parentheses, Exponential
  4. Exponential, Parentheses, Multiplication, Division, Addition, Subtraction

17 / 40

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

18 / 40

18.

What will be the output of below Python code?

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

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

19 / 40

19.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

20 / 40

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

21 / 40

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

22 / 40

22. Python can be used to handle big data and perform complex mathematics.

23 / 40

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

24 / 40

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

25 / 40

25. Which of the following is the use of function in python?
a) Functions are reusable pieces of programs
b) Functions don’t provide better modularity for your application
c) you can’t also create your own functions
d) All of the mentioned

26 / 40

26. X wants to allow the program to repeatedly ask the user to enter their Choice if it does not equal the Answer. Which loop option should X use?

a) while Choice == Answer:

Choice = input()

b) while Choice != Answer:

Choice = input()

c) while Answer != Choice:

Choice = input()

d) while Answer =! Choice:

Choice = input()

 

27 / 40

27. Variable names are case-sensitive

28 / 40

28.

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

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

29 / 40

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

30 / 40

30.

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

31 / 40

31.

Which function overloads the >> operator?

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

32 / 40

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

33 / 40

33. During Installation Make sure to select both the checkboxes at the bottom .

34 / 40

34.

What will be the output of below Python code?

str1="Information"print(str1[2:8])

A. format
B. formatio
C. orma
D. ormat

35 / 40

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

36 / 40

36.

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

37 / 40

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

38 / 40

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

39 / 40

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

40 / 40

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

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.