100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
WGU C173 Scripting and Programming Actual preparation test exam with Thorough and Correct Answers Updated 2024/2025 $12.99   Add to cart

Exam (elaborations)

WGU C173 Scripting and Programming Actual preparation test exam with Thorough and Correct Answers Updated 2024/2025

 4 views  0 purchase
  • Course
  • WGU C173
  • Institution
  • WGU C173

WGU C173 Scripting and Programming Actual preparation test exam with Thorough and Correct Answers Updated 2024/2025 What is a parameter? - correct answer Input to a procedure or function What is the difference in an input, an operand, and a parameter? - correct answer Nothing! They are all diff...

[Show more]

Preview 4 out of 100  pages

  • November 8, 2024
  • 100
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • WGU C173
  • WGU C173
avatar-seller
KieranKent55
WGU C173 Scripting and Programming
Actual preparation test exam with Thorough
and Correct Answers Updated 2024/2025
What is a parameter? - correct answer Input to a procedure
or function


What is the difference in an input, an operand, and a parameter?
- correct answer Nothing! They are all different names used
to describe inputs to a procedure.


What are the advantages of using a function? - correct
answer Functions can be used multiple times. They provide a
modular piece of code that only has to be written once and then
can be called upon multiple times within the program.


When does a function execute? - correct answer When you
explicitly ask it to execute by calling the function and passing in
any parameters. We refer to this as invoking or calling the
function.


How do you define outputs for a function? - correct answer
Using the return keyword you can define what data will be
returned or output when the procedure or function runs. You can
only access data from within a function if you return that specific
data to be used outside of the function.


How is a while loop constructed in Python? What is its purpose? -
correct answer executes any number of times, continuing as
long as the test expression is True

,while <TestExpression>:
<Block>


How is an if else statement constructed in Python? What is its
purpose? - correct answer provides a way to control what
code executes based on the result of a test expression
if <TestExpression>:
<block>
else:
<block>


How are compound mathematical expressions evaluated in
Python? - correct answer First perform calculations within
parentheses.
Next work left to right and perform all multiplication and
division.
Finally, work left to right and perform all addition and
subtraction


What is the function of parentheses, (), in programming
expressions? - correct answer When we are working with an
expression, they group items within that expressions. Items
within parentheses are evaluated first. For example:
(5 + 3) * 8 = 64 because we do the addition first, then
multiplication
5 + 3 * 8 = 29 because we do the multiplication first, then the
addition.

,We also use parentheses in procedures to define the inputs to
that procedure, which is a very different idea than when working
within an expression..


< - correct answer less than


> - correct answer greater than


<= - correct answer less than or equal to


>= - correct answer greater than or equal to


== - correct answer comparisons equality


How does the OR operator evaluate two operands? - correct
answer If <Expression1> has a True value, the result is True
and <Expression2> is not evaluated (so even if it would produce
an error it does not matter). If <Expression1> has a False value,
the result of the or is the value of <Expression2>.


How does the AND operator evaluate two operands? - correct
answer If <Expression1> has a False value, the result is False
and <Expression2> is not evaluated (so even if it would produce
an error it does not matter). If <Expression1> has a True value,
the result of the and is the value of <Expression2>.


How are elements in a list indexed? - correct answer List
elements are assigned an index number starting with 0.

, What is mutation? Do lists support mutation? - correct
answer This is the ability to change the value of something.
Lists support mutation, allowing you to change the overall length
as well as individual elements within the list.


How is a for loop constructed in Python? What is its purpose? -
correct answer A for loop provides a way to execute a block
once for each element of a list. The syntax is this:
for <Name> in <List>:
<Block>


How do you select a sub-sequence of a list with Python? -
correct answer You specify the index position to begin the
selection and the index position by which to stop the selection.
For example, the following code would print red and yellow
because they are at position 0 and 1.The value of 2 tells us to
stop the selection at position 2, but not to include it.


myColors = ["red","yellow","blue","orange","green"]
print myColors[0:2]


What does the pop method do to a list in Python? - correct
answer By default it removes the last element from a list. It can
also be used with an index number to remove a specific element
that is not in last place. For example, the following code would
print red, yellow, blue, and orange because pop removed green
from the end of the list.

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller KieranKent55. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $12.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

77254 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$12.99
  • (0)
  Add to cart