BUS 104 PYTHON EXAM REVIEW: Multiple Choice Questions and Answers
BUS 104 PYTHON EXAM REVIEW: Multiple Choice Questions and Answers If variable x has the value 3.99, which of the following will set variable y equal to 3? (Assume the math library has been imported.) - Correct Answer️️ -1) y = trunc(x) 2) y = round(x - 1) 3) y = floor(x) Which of the following can be used to assign 2 percent to variable discount? - Correct Answer️️ -None of these answers A computer program is always made up of: - Correct Answer️️ -code The following code represents a ________________ if structure. if a >= 1: if a == 1: - Correct Answer️️ -nested How many lines of output will be printed by the following code? sum = 0 for i in range(1,3): for j in range(1,4): sum += i * j print(sum) - Correct Answer️️ -6PDF DOCUMENT The following program is intended to display True Love. The program contains an error. Which answer best describes the problem with the program? a = True b = "Love" print(a + " " + b) - Correct Answer️️ -A string cannot be concatenated with a Boolean Given the following list, which statement would print New York? city_list = ["Atlanta", "New York", "Baltimore", "Phoenix", "Dallas"] - Correct Answer️️ - print(city_list[1]) In Lab 3, we calculated weekly gross pay for employees entitled to "time-and-a-half" for hours worked over 40. If an employee worked over 40 hours, what pay rate was used to for the first 40 hours worked? - Correct Answer️️ -the base hourly rate Which operator is used for exponentiation in Python? - Correct Answer️️ -** What code should be added to the end of the following code to di
Written for
- Institution
- Python Programming
- Course
- Python Programming
Document information
- Uploaded on
- June 17, 2024
- Number of pages
- 5
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
bus 104 python exam review multiple choice questi
Also available in package deal