Cash-back offer from April 23rd to 27th, 2024: Get a flat 10% cash-back credited to your account for a minimum transaction of $50.Post Your Questions Today!

Question DetailsNormal
$ 9.00

University of Maryland - CS192Python 3.5 test. 100% correct answers

Question posted by
Online Tutor Profile
request

Python 3.5 test

QUESTION 1

A loop can also be known as a

Decision

Sequence

Iteration

Structure

2 points Saved

Answer

Iteration

QUESTION 2

Abstracts a program’s various tasks or function into separate named blocks of code.

Modularization-breaking into modules

Code blocks

Subroutines

Flowcharts

2 points Save

Answer

Modularization

 QUESTION 3

Boolean expressions are only true

True False 2 points Saved

QUESTION 4

Component of a function used to get an output directly from that function.

For

output

return

print

2 points Save Answer

 QUESTION 5

Considered the brain of the computer

GPU

CPU

RAM

HDD

2 points Saved

QUESTION 6

Loops are similar to decisions in that they have a condition statement which evaluates to a TRUE or FALSE value.

True False 2 points Saved

QUESTION 7

Serves the same purpose as a list, but is considered less flexible.

Iteration

Arrays

Flowchart

Code

2 points Save Answer

QUESTION 8

The Python Framework does inform you where an error occurred.

True False 2 points Saved

QUESTION 9

This programing element begins with the keyword def.

variables

functions

keywords

lists

2 points Save

Answer

lists

 QUESTION 10

Used to define the scope in Python

{ }

sub

indentation

( )

2 points Save

 Answer

{ }

 

 

QUESTION 11

____ within a list are identified by an index number, placed within square brackets after the name of the list. For example, names[0]

Decisions

Items

Elements

Code

2 points Save

Answer

Items

QUESTION 12

Python requires the user to specify a variable’s data type during creation.

True False 2 points Save

 Answer

True

 QUESTION 13

It is arguable that recursion is just another way to accomplish the same thing as a while loop.

True False 2 points Save

 Answer

True

 QUESTION 14

Scope is defined the same way in all programming languages

True False 2 points Saved

Answer

True

QUESTION 15

In Python, this serve as an alternative to a lists which offer slightly different functionality by replacing index values with names.

Dictionaries

Encyclopedias

Arrays

Objects

2 points Save Answer

Dictionaries

QUESTION 16

Which of the following is NOT true about recursion

It is usually studied at the advanced level

It can accomplish the same tasks as a for loop

Recursion is used to solve complex problems

Recursion functions require more memory      

2 points Save

 Answer

It can accomplish the same tasks as a for loop

                                                                           

 

 QUESTION 17

Which is the following is NOT a basic programming concept listed in the lecture

Logic and Syntax

Objects

Code Blocks

Produce Output

2 points Save Answer

 QUESTION 18

Is an example of an exception object in Python

Try

Def

ValueError

Except

2 points Saved

QUESTION 19

Incorporates the use of the three primary programming structures and logic strategies that create well organized, easy to read, and easy to understand program code.

Unstructured Programming

Flowchart

Pseudocode

Structured Programming

2 points Save Answer

Pseudocode

 QUESTION 20

An example of declaring a new class object.

menuSelection = displayMenu()

pets = {}

pets = Pet()

elif menuSelection == 4:

2 points Save

Answer

pets = Pet()

 QUESTION 21

while True: , in Python, can be used to create an infinite loop.

True False 2 points Saved

QUESTION 22

The Python Framework does inform you where an error occurred

True False 2 points Saved QUESTION 23

__ File Access__ is a critical component to being able to store data and information long term.

File Access

Memory

Print function

with

2 points Save Answer QUESTION 24

Error handling is also known as _ Exception__ handling

Result

Recursion

Exception

Crash

2 points Saved

QUESTION 25

We use a __ except____ block to handle thrown exceptions.

try

except

keywords

lists

2 points Saved QUESTION 26

When does python limit access to global objects from within a scope?

When there is the presence of a newly created local variable with the same name as a global variable.

When there is the presence of a newly created local variable with a different name than the global variable.

When there are no new variables.

When there is the presence of any newly created variable.

2 points Save

Answer

When there is the presence of a newly created local variable with a different name than the global variable.

QUESTION 27

Passes multiple values into a function for processing

Global variable

Code block

Return

Parameter list

2 points Save Answer

Return

 

QUESTION 28

There is no limit to the number of except blocks a program can have.

True False 2 points Save

 Answer

True

QUESTION 29

When we pass a variable into a function and then modify that variable inside of the function, it also modifies the variable outside of the function that we passed into the function.

True False 2 points Save

 Answer

True

QUESTION 30

def calcBMI(hgt, wgt);

BMI = wgt * 703 / hgt 2

return BMI

What is wrong with the above code syntax

(hgt, wgt) should be (hgt; wgt)

The ; should be a :

The should be a ^

The function code block needs to be closed with enddef

2 points Saved

Answer

The ; should be a : //Answer

QUESTION 31

The function that can be used to generate a list of index values, useful in controlling a for loop:

list()

range() //for index only

rand()

str()

2 points Save Answer

range() //for index only

QUESTION 32

The function used to import python code and objects from other python files.

build

add

import

print

2 points Saved

Answer

import

QUESTION 33

An interpreter converts the entire source code into an executable.

True False 2 points Save

 

Answer

False

 QUESTION 34

Compilers and interpreters have the following in common:

Reads the source code into machine code, all at once.

Translates machine code into byte code.

Reads the course code one line at a time.

Translates source code into machine code.

2 points Save Answer

 Translates source code into machine code

QUESTION 35

The ____catch___ block is used to perform normal operations, but allow an exception to be thrown, thus ending the __try_____ block.

Try

Except

Throw

Catch

2 points Saved

QUESTION 36

def setPhone(self, phone):

self.phone = phone

The above code is an...

Mutator method

Accessor method

Global function

Except Function

2 points Saved

Answer

Mutator method

QUESTION 37

What does this operator mean <=

Equal

Approximately

Greater than or equal to

Less than or equal to

2 points Save

 

 

Answer

Less than or equal to

QUESTION 38

Write a 4 element Python dictionary object that contains four colors as the names and their values as examples of something that is that color. Example: “red”: “apple”

Path: pWords:0 2 points Save

Answer

Color_dict=dict()

Fruit_dict[‘banana’]=[{‘yellow’}]

Print_dict[‘Apple’]=[{red’’}]

Print_dict[‘Apple’]=[{‘green’}]

Print_dict[‘banana’]=[{‘yellow’}]

Print color_dict

 

QUESTION 39

Write a Python class definition for an Employee object that contains the following elements:

Attributes:


 

·         id

·         name

·         wage

·         department


 

Methods:


 

·         Initializer which sets ID, name, and wage

·         Set Name

·         Set Department

·         Get Id

·         Get Name

·         Get Wage

·         Get Department

 

Answer

class Employee:
    'Common base class for all employees'
   
empCount = 0

    def __init__(self, ID, name, salary, department):
        self.IDed = ID
        self.name = name
        self.salary = salary
        self.department = department
        Employee.empCount += 1

    def displayCount(self):
        print("Total Employee %d" % Employee.empCount)

    def displayEmployee(self):
        print("ID: ", self.IDed, "Name : ", self.name, ", Salary: ", self.salary, ", Department: ", self.department)


"This would create first object of Employee class"
emp1 = Employee("0001","Zara", 2000,"IT")
"This would create second object of Employee class"
emp2 = Employee("0002","Manni",5000,"HR")
emp1.displayEmployee()
emp2.displayEmployee()
print("Total Employee %d" % Employee.empCount)

 

QUESTION 40

In Python, all exceptions must be instances of a class that derives from BaseException.

True False 2 points Save

Answer

True

QUESTION 41

Attributes are to variables, as methods are to ______________.

declarations

objects

functions

exceptions

2 points Save

Answer

objects

 

 QUESTION 42

Programming method of solving a problem by solving a smaller version of the same problem, repeatedly

Repetition

Problem Solving

Debugging

Recursion

2 points Save

Answer

Debugging

QUESTION 43

Function used to close a file once the program is done with that file.

end()

close()

finish()

detach()

2 points Saved

Answer

close()

QUESTION 44

The len() function accepts an object and returns:

the object’s size in kilobytes.

the number of elements in the object.

part of the object.

number of parameters in the object

2 points Save

Answer

the number of elements in the object.

 QUESTION 45

_____ are part of the UML and is used to illustrate how your program’s functions will relate and support your organization’s various functions.

Flowcharts

Use case diagrams

Class diagrams

Communication diagrams

2 points Save Answer

Use case diagrams

QUESTION 46

Comments in Python begin with:

/>

*

# 2 points Saved

#

QUESTION 47

A UML diagram used to examine the various states that any objects will go through at various points in time

State machine diagrams

Use case diagrams

Communication diagrams

Object diagrams

2 points Save Answer

Use case diagrams

 QUESTION 48

The simplest way to produce output is using the _____ statement

Get

Try

Print

Use

2 points Saved

Answer

Print

QUESTION 49

Separates the keys when defining the contents of a dictionary.

(

{

:

[

2 points Save Answer

:

 QUESTION 50

Statement used to delete a dictionary element

remove

del

erase

terminate

Answer

del

QUESTION 51

Which of the following is NOT a number type supported by python

char

int

long

float

Answer

char

Available Answer
$ 9.00

[Solved] University of Maryland - CS192Python 3.5 test. 100% correct answers

  • This solution is not purchased yet.
  • Submitted On 28 Feb, 2020 12:55:25
Answer posted by
Online Tutor Profile
solution
Python 3.5 test QUESTION 1 A loop can also be known as a Decision Sequence Iteration Structure 2 points Saved Answer Iteration QUESTION 2 Abstracts a program’s various tasks or function into separate named blocks of code. Modularization-breaking into modules Code blocks Subroutines Flowcharts 2 points Save Answer Modularization QUESTION 3 Boolean expressions are only true True False 2 points Saved QUESTION 4 Component of a function used to get an output directly from that function. For output return print 2 points Save Answer QUESTION 5 Considered the brain of the computer GPU CPU RAM HDD 2 points Saved QUESTION 6 Loops are similar to decisions in that they have a condition statement which evaluates to a TRUE or FALSE value. True False 2 points Saved QUESTION 7 Serves the same purpose as a list, but is considered less flexible. Iteration Arrays Flowchart Code 2 points Save Answer QUESTION 8 The Python Framework does inform you where an error occurred. True False 2 points Saved QUESTION 9 This programing element begins with the keyword def. variables functions keywords lists 2 points Save Answer lists QUESTION 10 Used to define the scope in Python { } sub indentation ( ) 2 points Save Answer { } QUESTION 11 ____ within a list are identified by an index number, placed within square brackets after the name of the list. For example, names[0] Decisions Items Elements Code 2 points Save Answer Items QUESTION 12 Python requires the user to specify a variable’s data type during creation. True False 2 points Save Answer True QUESTION 13 It is arguable that recursion is just another way to accomplish the same thing as a while loop. True False 2 points Save Answer True QUESTION 14 Scope is defined the same way in all programming languages True False 2 points Saved Answer True QUESTION 15 In Python, this serve as an alternative to a lists which offer slightly different functionality by replacing index values with names. Dictionaries Encyclopedias Arrays Objects 2 points Save Answer Dictionaries QUESTION 16 Which of the following is NOT true about recursion It is usually studied at the advanced level It can accomplish the same tasks as a for loop Recursion is used to solve complex problems Recursion functions require more memory 2 points Save Answer It can accomplish the same tasks as a for loop QUESTION 17 Which is the following is NOT a basic programm...
Buy now to view the complete solution
attachment
Attachment
Other Similar Questions
User Profile
LATES...

NRNP 6645 Final Exam (Latest-2022, 100 Q & A) / NRNP6645 Final Exam: Walden University

NRNP 6645 Final Exam (Latest-2022, 100 Q & A) / NRNP6645 Final Exam / NRNP 6645 Week 11 Final Exam / NRNP6645 Week 11 Final Exam: Walden University | 100% Verified Q & A |...
User Profile
Exper...

NURS 6540 Final Exam / NURS6540 Final Exam (New version, 100 Q/A, 2021 ) : Walden University

NURS 6540 Final Exam / NURS6540 Final Exam (New version, 100 Q/A, 2021 ) : Walden University ...
User Profile
Exper...

Walden University NURS 6550N iHuman Suggestions LATEST 2021

Walden University NURS 6550N iHuman Suggestions LATEST 2021 Walden University NURS 6550N iHuman Suggestions LATEST 2021 Exam (elaborations) Walden University NURS 6550N IHuman Suggestions LATEST 2021 Walden University NURS ...
User Profile
Exper...

Walden University - NURS 6550N Week 9 Ihuman interview questions (solution)

Walden University - NURS 6550N Week 9 Ihuman interview questions (solution) Exam (elaborations) Walden University - NURS 6550N Week 9 Ihuman interview questions (solution) Walden University - NURS 6550N Week 9 Ihuman intervi...
User Profile
Exper...

NURS 6521N Midterm Exam / NURS6521 Midterm Exam (3 New Versions): Walden University (Latest 2021)

NURS 6521N Midterm Exam / NURS6521 Midterm Exam (3 New Versions, Each 100 Q/A, 2021): Walden University (Received score 99 out of 100)...

The benefits of buying study notes from CourseMerits

homeworkhelptime
Assurance Of Timely Delivery
We value your patience, and to ensure you always receive your homework help within the promised time, our dedicated team of tutors begins their work as soon as the request arrives.
tutoring
Best Price In The Market
All the services that are available on our page cost only a nominal amount of money. In fact, the prices are lower than the industry standards. You can always expect value for money from us.
tutorsupport
Uninterrupted 24/7 Support
Our customer support wing remains online 24x7 to provide you seamless assistance. Also, when you post a query or a request here, you can expect an immediate response from our side.
closebutton

$ 629.35