[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3.

Which one of the following is the correct extension of the Python file?

  1. .py
  2. .python
  3. .p
  4. None of these

4 / 40

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

5 / 40

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

6 / 40

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

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

10.

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

11 / 40

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

12 / 40

12. Comments can be used to explain Python code.

13 / 40

13. A variable name cannot start with a number

14 / 40

14. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

15 / 40

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

a. 5

b. 3

c. 6

d. 7

16 / 40

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

17 / 40

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

18 / 40

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

19 / 40

19.

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

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

20 / 40

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

21 / 40

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

22 / 40

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

23 / 40

23. Is there any comments in  following codes

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

 

24 / 40

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

25 / 40

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

26 / 40

26.

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

27 / 40

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

28 / 40

28. Bitwise operators are used to compare (binary) numbers

29 / 40

29. With the break statement we can stop the loop even if the while condition is true

30 / 40

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

 

31 / 40

31.

What will be the output of above Python code?

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

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

32 / 40

32. Python is a  high-level programming language.

33 / 40

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

34 / 40

34. Python has various versions available

35 / 40

35.

 Select the correct example of complex datatype in Python

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

36 / 40

36. The format() method takes the passed arguments

37 / 40

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

38 / 40

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

39 / 40

39. The list’s remove() method only removes the first occurrence of the specified value.

40 / 40

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

Exit



Hurry Up!

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