Question 1. What function is used to remove leading and trailing whitespace from a string variable?
| A. trim | |
| B. strip | |
| C. remspaces | |
| D. empty |
Question 2. What statement is used to force a loop
to stop processing the current iteration and start the next
iteration?
| A. continue | |
| B. break | |
| C. The for-in loop | |
| D. While True |
Question 3. What function is used to add a value
to a list?
| A. end | |
| B. pop | |
| C. add | |
| D. append |
Question 4. Which statement gets control of
processing when an Exception Error is found in a "try"
statement?
| A. catch | |
| B. except | |
| C. error | |
| D. exception |
Question 5. What is the most significant purpose
for defining and using a Python module?
| A. To store a consistent set of variable values (i.e. constants) that can be used in many programs | |
| B. To simplify the coding structure | |
| C. To store functions that can be used by another .py program when the module is imported | |
|
D. To speed up the Python application processing |
Question 1. trim function is used to remove leading and trailing whitespace from a string variable? Question 2. break statement is used to force a loop to stop processing the current iteration and start the next iteration? Question 3. append function is used to add a value to a list? Question 4. except statement gets control of processing when an Exception Error is found in a "try" statement? Question 5. Python module is used to store functions that can be used by another .py program when the module is imported Answer: Option 3
Question 1. What function is used to remove leading and trailing whitespace from a string variable?...
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 9 (CO 6) The best way to call the main() function of a program is to code main() a while statement that calls the main() function in each loop an if statement that calls the main() function in each method an if statement that calls the main() function only if the current module is the main module Question 10 (CO 6) A variable that can only be used within the function that defines it is known as a ______...
hello, please help me to answers my python subjects, I'm new students. I highly appreciate your effort. thanks in advanced.. Kindly answers all of this please, I'm begging... 1.) Knowing that a function named fun() resides in a module named mod, choose the proper way to import it: a.) from mod import fun b.) from fun import mod c.) import fun d.) import fun from mod 2.) Knowing that a function named fun() resides in a...
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 __________....
QUESTION 1 Which of the following Python variable names has syntax error ? OA. A. CSC121 OB. B. CSC121 Oc. C. CSC-121 D. None of the above QUESTION 2 What data type will Python use to store the value of num_students ? num_students = 17.0 A. floating point number (i.e. float) OB. B. integer (i.e. int) Oc. string (i.e. str) Od. D. None of the above
1) Which of the following is NOT true about a Python
variable?
a) A Python variable must have a value
b) A Python variable can be deleted
c) The lifetime of a Python variable is the whole duration of a
program execution.
d) A Python variable can have the value
None.
2) Given the code segment:
What is the result of executing the code segment?
a) Syntax error
b) Runtime error
c) No error
d) Logic error
3) What...
Question 1 Not yet answered Marked out of 1.00 Not flaggedFlag question Question text The statements inside of a Python loop are known as the ____ of the loop. Select one: a. body b. expression c. counter d. block Question 2 Not yet answered Marked out of 1.00 Not flaggedFlag question Question text The Python 3 program below prints the number 3. s = "Python3" print(s[len(s)]) Select one: True False Question 3 Not yet answered Marked out of 1.00 Not...
Question 1 The following function header represents which programming language? double calc_weekly_pay( double hours_worked, double pay_rate) Question 1 options: Python A C-based language FORTRAN COBOL Question 2 One of my favorite quotes from Jeanette Wind is "Computational thinking is using abstraction and decomposition when attacking a large complex task or designing a large complex system." This supports using _____________ when developing programs. Question 2 options: Repetition structures Assignment statements Selection structures Functions Question 3 The following assignment statement exhibits which...
Chapter 08 Python Assignment: Question 1-5 Please I need help in my python course. Question 1 The finally clause of a try statement a. can be used to recover from an exception b. is required c. can be used to display more information about an exception d. is executed whether or not an exception has been thrown 10 points Question 2 Which of the following is the correct way to code a try statement that catches any type of exception...
Questions 1. How to create a comment in python? 2. The way to obtain user input from command line 3. List standard mathematical operators in python and explain them 4. List comparison operators in python 5. Explain while loop. Give example 6. Explain for loop. Give example 7. How to create infinite loop? And how to stop it? 8. Explain a built-in function ‘range’ for ‘for’ loop 9. Explain break statement 10. Explain continue statement 11. Explain pass statement 12....