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

3 / 40

3. A variable name cannot start with a number

4 / 40

4.

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

a. Define

b. DEF

c. def

d. Def

5 / 40

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

6 / 40

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

7 / 40

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

8 / 40

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

9 / 40

9.

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

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

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

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

14 / 40

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

15 / 40

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

16 / 40

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

a. 5

b. 3

c. 6

d. 7

17 / 40

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

18 / 40

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

 

19 / 40

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

20 / 40

20. Comments can be used to explain Python code.

21 / 40

21. Python relies on indentation?

22 / 40

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

23 / 40

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

24 / 40

24.

What is the data type of print(type(0xFF))

25 / 40

25. What is the output of the given below program?

if 1 + 3 == 7:    print("Hello")else:    print("Know Program")

a) Hello
b) Know Program
c) Compiled Successfully, No Output.
d) Error

26 / 40

26. Python can connect to database systems.

27 / 40

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

28 / 40

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

29 / 40

29. Python allows you to extract the values into variables.

30 / 40

30.

What will be the output of below Python code?

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

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

31 / 40

31.

What will be the output of below Python code?

tupl=([2,3],"abc",0,9)tupl[0][1]=1print(tupl)A. ([2,3],"abc",0,9)B. ([1,3],"abc",0,9)C. ([2,1],"abc",0,9)D. Error

32 / 40

32. Variables that are created outside of a function

33 / 40

33. Indentation refers to the spaces at the beginning of a code line.

34 / 40

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

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. With the break statement we can stop the loop even if the while condition is true

37 / 40

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

38 / 40

38. Comments can be used to make the code more readable.

39 / 40

39.

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

40 / 40

40.

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

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

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.