QUESTION 21
while True: , in Python, can be used to create an infinite loop.
True
False
2 points
QUESTION 22
The Python Framework does inform you where an error occurred
True
False
2 points
QUESTION 23
____ is a critical component to being able to store data and information long term.
|
File Access |
||
|
Memory |
||
|
Print function |
||
|
with |
2 points
QUESTION 24
Error handling is also known as ___ handling
|
Result |
||
|
Recursion |
||
|
Exception |
||
|
Crash |
2 points
QUESTION 25
We use a ______ block to handle thrown exceptions.
|
try |
||
|
except |
||
|
keywords |
||
|
lists |
2 points
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
QUESTION 27
Passes multiple values into a function for processing
|
Global variable |
||
|
Code block |
||
|
Return |
||
|
Parameter list |
2 points
QUESTION 28
There is no limit to the number of except blocks a program can have.
True
False
2 points
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
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 |
21) true
22)true
23) file access
24) exception
25(except
26)When there is the presence of a newly created local variable with the same name as a global variable.
27)Parameter list
28) true
29)The ; should be a :
26)
QUESTION 21 while True: , in Python, can be used to create an infinite loop.
True
QUESTION 22 The Python Framework does inform you where an error occurred
True
QUESTION 23 ____ is a critical component to being able to store data and information long term.
File Access
QUESTION 24 Error handling is also known as ___ handling
Exception
QUESTION 25 We use a ______ block to handle thrown exceptions.
try
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.
QUESTION 27 Passes multiple values into a function for processing
Parameter list
QUESTION 28 There is no limit to the number of except blocks a program can have.
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
QUESTION 30 def calcBMI(hgt, wgt);
kotlinCopy codeBMI = wgt * 703 / hgt ** 2 return BMI
What is wrong with the above code syntax
The ; should be a :
The function code block needs to be closed with enddef
QUESTION 21 while True: , in Python, can be used to create an infinite loop. True...
This is for Python class questions. 1 Python question: While you can add or subtract an int value to or from a Decimal object, you cannot __________ Decimal objects with __________. A multiply, ints B mix, float values C divide, anything D mix, the quantize method 2 Python question: One way to deal with unexpected results that may come from floating-point numbers is to use rounding, but you can also use decimal numbers by importing the __________ from the __________....
A. Write a Python script so that the user can enter any number of grades. Create a calcavg() function so that it takes the number of grades as a parameter and returns the regular average (not a weighted average). You must loop through the grades for full credit. Add a try/except block so that if a non-numeric value is entered, you get the error message shown below. You cannot use lists. Input: c. python …\IT2430\FirstLastname\assign5-2.py 96.7 95.6 87.0 d. python...
Question 21 The loop condition can be a complex condition involving several operators. True OR False Question 22 final int MAX = 25, LIMIT = 100; int num1 = 12, num2 = 25, num3 = 87; if(num3-5 >= 2*LIMIT) { System.out.println ("apple"); } else { System.out.println ("orange"); } System.out.println("grape"); What prints? A. Apple B. Orange C. Grape D. apple grape E. orange grape F. Nothing. Question 23 When we use a while loop, we always know in advance how many...
True or False: Python programs require two or more modules. 1. 2. The keyword while means the same thing as While in Python. 3. In Python, _MyVar15 is a valid variable name. 4. To make your program more secure, use obscure variable names such as xz14dEE 5. Indenting code that should be executed when an if statement evaluates as true makes your program easier to read, but the indentation is not necessary. 6. A dictionary object contains zero or more...
Question 1 True and False are Boolean keywords in Python True False Question 2 0.0/1.0 point (graded) hot_plate = True if hot_plate: print("Be careful, hot plate!") else: print("The plate is ready.") The output of from running the above code is ___ "Be careful, hot plate!" "The plate is ready." "True" NameError Question 3 0.0/1.0 point (graded) vehicle_type = "Truck" if vehicle_type.upper().startswith("P"): print(vehicle_type, 'starts with "P"') else: print(vehicle_type, 'does not start with "P"') The...
visual basic help
DI Question 3 2 pts You may only bind an object to a control that the computer creates for you O True O False D | Question 4 2 pts The Do..Loop statement can be used to code both a pretest loop and a posttest loop. True False Question 5 2 pts You can prevent many unintentional errors from occurring in an application by declaring the variables using the maximum scope needed. True False 2 pts Question...
Python Programming QUESTION 16 Which of the following is an example of a Keyword in Python? elif class for All of the above QUESTION 17 Which of the following is not an acceptable variable name in Python? 2ndVar $amount Rich& ard None of the above are acceptable variable names QUESTION 18 The number 1 rule in creating programs is ___________________- Write the code first Think before you program Let the compiler find you syntax errors There are no rules just...
QUESTION 1 Even though the Fed was created in 1913, while we were still on the gold standard, it didn’t need to hold any gold reserves for the notes it created. True False True False 1 points QUESTION 2 From 1914 until 1920, the level of total bank demand deposits (checking accounts) rose by over two hundred percent, while currency in circulation hardly changed at all, rising only by 5.4%. True False 1 points QUESTION 3 The most...
CODE ONE #include #include using namespace std; string x =" I am global"; // Global x int main() { string x = " I am local"; // Local x cout< cout<<::x< return 0; } CODE TWO #include #include using namespace std; string str = "i am global ";// global int main() { string srt = "i am local to main() ";//local to main() cout << str << "---" << ::str << "\n";// LINE 5555. int x=5; int y=6; if...
1. True/False: An infinite loop occurs in a pre-test loop when a test condition can never be met. 2. True/False: An infinite loop occurs in a post-test loop when a test condition can never be met. 3. True/False: The following statement will generate a loop with four iterations: for(count = 4; count > 0; count--) 4. True/False: The problem with a do...while loop is that the test condition cannot be a compound condition. 5. True/False: The following test...