Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Question: 1. If you were to look at a machine language program, you would see __________.

a) Python code

b) a stream of binary numbers

c) English words

d) circuits

2. A(n) ____________ is a set of instructions that a computer follows to perform a task.

a) compiler

b) program

c) interpreter

d) programming language

3. The words that make up a high-level programming language are called __________.

a) binary instructions

b) mnemonics

c) commands

d) key words

4. The rules that must be followed when writing a program are called __________.

a) syntax

b) punctuation

c) key words

d) operators

5. A syntax error does not prevent a program from being compiled and executed.

a) True

b) False

6. A __________ error does not prevent the program from running, but causes it to produce incorrect results.

a) syntax

b) hardware

c) logic

d) fatal

7. A(n) __________ is a set of well-defined logical steps that must be taken to perform a task.

a) logarithm

b) plan of action

c) logic schedule

d) algorithm

8. An informal language that has no syntax rules and is not meant to be compiled or executed is called __________.

a) faux code

b) pseudocode

c) Python

d) a flowchart

9. A string literal in Python must be enclosed in __________.

a) parentheses

b) single-quotes

c) double-quotes

d) either single-quotes or double-quotes

10. Short notes placed in different parts of a program explaining how those parts of the program work are called __________.

a) comments

b) reference manuals

c) tutorials

d) external documentation

11. Which of the following statements will cause an error?

a) x = 17

b) 17 = x

c) x = 99999

d) x = '17'

12. Suppose the following statement is in a program: price = 99.0. After this statement executes, the price variable will reference a value of this data type.

a) int

b) float

c) currency

b) str

13. This built-in function can be used to convert an int value to a float.

a) int_to_float()

b) float()

c) convert()

d) int()

14. In a math expression, multiplication and division takes place before addition and subtraction.

a) True

b) False

15. Variable names can have spaces in them.

a) True

b) False

16. If you print a variable that has not been assigned a value, the number 0 will be displayed.

a) True

b) False

17. A __________ structure can execute a set of statements only under certain circumstances.

a) sequence

b) circumstantial

c) decision

d) Boolean

18. A(n) __________ expression has a value of either true or false.

a) binary

b) decision

c) unconditional

d) Boolean

19. The symbols >, <, and == are all __________ operators.

a) relational

b) logical

c) conditional

d) ternary

20. A compound Boolean expression created with the __________ operator is true only if both its subexpressions are true.

a) and

b) or

c) not

d) both

21. A compound Boolean expression created with the __________ operator is true if either of its subexpressions is true.

a) and

b) or

c) not

d) either

22. A __________ is a Boolean variable that signals when some condition exists in the program.

a) flag

b) signal

c) sentinel

d) siren

23. A(n) __________ is a special value that signals when there are no more items from a list of items to be processed. This value cannot be mistaken as an item from the list.

a) sentinel

b) flag

c) signal

d) accumulator

24. The following is NOT an augmented assignment operator:

a) +=

b) -=

c) *=

d) ==

25. A count-controlled loop always repeats a specific number of times.

a) True

b) False

26. A design technique that helps to reduce the duplication of code within a program and is a benefit of using functions is __________.

a) code reuse

b) input validation

c) debugging

d) facilitation of teamwork

27. Calling a function and defining a function mean the same thing.

a) True

b) False

28. In Python you cannot write functions that accept multiple arguments.

a) True

b) False

29. A statement in one function can access a local variable in another function.

a) True

b) False

30. A function in Python can return more than one value.

a) True

b) False

31. Which function in the math module will round up to 4?

a) round(3.14)

b) int(3.14)

c) math.ceil(3.14)

d) math.floor(3.14)

32. Before a file can be used by a program, it must be

a) formatted

b) encrypted

c) closed

d) opened

33. When a program is finished using a file, it should do this.

a) erase the file

b) open the file

c) close the file

d) encrypt the file

34. When an exception is generated, it is said to have been __________.

a) built

b) raised

c) caught

d) killed

35. This is a section of code that gracefully responds to exceptions.

a) exception generator

b) exception manipulator

c) exception handler

d) exception monitor

36. You write this statement to respond to exceptions.

a) run/handle

b) try/except

c) try/handle

d) attempt/except

37. When you open a file that already exists on the disk using the 'w' mode, the contents of the existing file will be erased.

a) True

b) False

38. If you do not handle an exception, it is ignored by the Python interpreter, and the program continues to execute.

a) True

b) False

39. You can have more than one except clause in a try/except statement.

a) True

b) False

40. The else suite in a try/except statement executes only if a statement in the try suite raises an exception.

a) True

b) False

41. The following statement can cause an exception: names_file = open('names.txt', '

a) True

b) False

42. This term refers to an individual item in a list.

a) element

b) bin

c) array

d) slot

43. This is a number that identifies an item in a list.

a) element

b) index

c) bookmark

d) identifier

44. This is the first index in a list.

a) -1

b) 1

c) 0

d) The size of the list minus one

45. This is the last index in a list.

a) 1

b) 99

c) 0

d) The size of the list minus one

46. This will happen if you try to use an index that is out of range for a list.

a) A ValueError exception will occur.

b) An IndexError exception will occur.

c) The list will be erased and the program will continue to run.

d) Nothing - the invalid index will be ignored.

47. This function returns the length of a list.

a) length

b) size

c) len

d) lengthof

48. This list method adds an item to the end of an existing list.

a) add

b) add_to

c) increase

d) append

49. This file object method returns a list containing the file's contents.

a) to_list

b) getlist

c) readline

d) readlines

50. Lists in Python are immutable.

a) True

b) False

51. Tuples in Python are immutable.

a) True

b) False

52. A file object's writelines method automatically writes a newline ('\n') after writing each list item to the file.

a) True

b) False

53. You can use the + operator to concatenate two lists.

a) True

b) False

54. A list can be an element in another list.

a) True

b) False

55. Given the following Python code, what will the data type of pet be?
pet = "Gordon", "Gecko", 3

a) string

b) list

c) tuple

d) undefined

56. This is the first index in a string.

a) -1

b) 1

c) 0

The size of the string minus one

57. This is the last index in a string.

a) 1

b) 99

c) 0

d) The size of the string minus one

58. This will happen if you try to use an index that is out of range for a string.

a) A ValueError exception will occur.

b) An IndexError exception will occur.

c) The string will be erased and the program will continue to run.

d) Nothing - the invalid index will be ignored.

59. This function returns the length of a string.

a) length

b) size

c) len

d) lengthof

60. This operator determines whether one string is contained inside another string.

a) contains

b) is_in

c) ==

d) in

61. This string method returns true if a string contains only alphabetic characters and is at least one character in length.

a) isalpha()

b) alpha()

c) alphabetic()

d) isletters()

62. This string method returns true if a string contains only numeric digits and is at least one character in length.

a) digit()

b) isdigit()

c) numeric()

d) isnumber()

63. You can use the for loop to iterate over the individual characters in a string.

a) True

b) False

64. The isupper method converts a string to all uppercase characters.

a) True

b) False

65. The repetition operator (*) works with strings as well as with lists.

a) True

b) False

66. You can use the __________ operator to determine whether a key exists in a dictionary.

a) &

b) in

c) ^

d) ?

67. You use __________ to delete an element from a dictionary.

a) the remove method

b) the erase method

c) the delete method

d) the del statement

68. The __________ function returns the number of elements in a dictionary:

a) size()

b) len()

c) elements()

d) count()

69. You can use __________ to create an empty dictionary.

a) {}

b) ()

c) []

d) empty()

70. The __________ method returns a randomly selected key-value pair from a dictionary.

a) pop()

b) random()

c) popitem()

d) rand_pop()

71. The __________ method returns the value associated with a specific key and removes that key-value pair form the dictionary.

a) pop()

b) random()

c) popitem()

d) rand_pop()

72. The __________ dictionary method returns the value associated with a specified key. If the key is not found, it returns a default value.

a) pop()

b) key()

c) value()

d) get()

73. When an object is __________, it is converted to a stream of bytes that can easily be stored in a file for later retrieval.

a) defined

b) serialized

c) set

d) iterated over

74. The __init__ method is called automatically when __________.

a) a module is imported

b) a class is defined

c) a function is defined

d) an object is created

75. What is encapsulation?

a) a module used to serialize data

b) the combining of data and code into a single object

c) the process of indenting and formatting code

d) a structure used to iterate over data

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92297850

Have any Question?


Related Questions in Computer Engineering

Stuck in the mud is a popular dice game in uk the game uses

Stuck in the mud is a popular dice game in UK. The game uses five (5) 6-sided dice to play. The players play in turns. Choose one player to start the game. The player will roll all five (5) dice. If the player rolled any ...

Write a program to calculate the average temperature for

Write a program to calculate the average temperature for the year and determine the hottest month of the year. In your main method, the program should collect the user input of the average Fahrenheit temperatures for eac ...

Question steve jobs was a strong charismatic leader who

Question: Steve Jobs was a strong, charismatic leader who co-founded Apple and is credited with much of the success of the company. Some believe that Tim Cook, who became CEO in 2011, embraces a more collaborative leader ...

Question explain why you should always search the free

Question: Explain why you should always search the free space and slack space if you suspect person who deliberately delete file or information on a workstation that you are analyzing. The response must be typed, single ...

If we compare and contrast the four market structures it is

If we compare and contrast the four market structures, it is evident that one market structure is most practiced and evident in the United States. It is the one that promotes and strives on competition. It is the one tha ...

Ethics and the information security professionwhat are the

ETHICS AND THE INFORMATION SECURITY PROFESSION What are the ethical dilemmas and challenges faced by information security professionals? Are professional organizations' ethical codes of conduct beneficial as an informati ...

Explain a business process you are familiar with describe

Explain a business process you are familiar with. Describe how a computer-based information system is related (or used) in this business process. Explain how a computer-based information systems can improve the efficienc ...

Question write a minimum of 100 words for each question

Question: Write a minimum of 100 words for each question. Provide Citation and reference for each question. Provide two responses for each question. 1. Let us suppose we are designing a computer for use for a graphic art ...

1 a university found that 10 of students withdraw from a

1. A university found that 10% of students withdraw from a math course. Assume 25 students are enrolled. a. Write the appropriate probability distribution function with the specific parameters for this problem. b. Comput ...

Question you will submit a business case proposal which is

Question: You will submit a Business Case Proposal, which is a summary of your selected business case for the course project. The business case proposal will be submitted as a Word document and in paragraph form. This bu ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As