100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
Previously searched by you
WGU D385 Pre-Assessment (The OA is basically identical to the PA but you will have to fill out different sections of the coding problems, I strongly suggest you memorize every part of this) All Correct, 2024 Questions With Complete Solutions!!$13.99
Add to cart
WGU D385 Pre-Assessment (The OA is basically identical to the PA but you will have to fill out different sections of the coding problems, I strongly suggest you memorize every part of this) All Correct, 2024 Questions With Complete Solutions!!
58 views 0 purchase
Course
WGU D385
Institution
WGU D385
WGU D385 Pre-Assessment (The OA is basically identical to the PA but you will have to fill out different sections of the coding problems, I strongly suggest you memorize every part of this) All Correct, 2024 Questions With Complete Solutions!!
WGU D385 Pre-Assessment ( The OA is basically identical to the PA but you will have to fill out different sections of the coding problems, I strongly suggest you memorize every part of this) All Correct, 2024 Questions With Complete Solutions!!
What is the primary defense against log injection attacks? Answer- Sanitize outbound log messages
import logging
import sys
import logging
import sys
#log division by zero error to the log, the output is printed to the screen def divideByZeroError(dividend, divisor): logging.basicConfig(stream=sys.stdout,format='%(levelname)s:%(message)s') try: quotient = dividend/divisor print (quotient) except Exception as e: #logging error here, use str(e) as part of the output
if __name__ == '__main__': dividend = int(input()) divisor = int(input()) divideByZeroError(dividend,divisor) Answer- logging.error("The exception that occured is: %s", str(e))
An attacker exploits a cross-site scripting vulnerability. Answer- Access the user's data Which Python function is prone to a potential code injection attack? Answer- eval()
What are two common defensive coding techniques? Answer- Check functional and preconditions and postconditions
# unit test case
import unittest
def multiply_numbers(x, y): #add your code here return x * y # add your code here class TestForNone(unittest.TestCase): def test_when_a_is_null(self): try: self.assertIsNone(multiply_numbers(5, None)) except AssertionError as msg: print(msg)
if __name__ == '__main__': unittest.main() Answer- if x is None: print("x is a null value") return y
elif y is None: print("y is a null value") return x
else: return x * y
Which package is meant for internal use by Python for regression testing? Answer- test
from string import Template
CONFIG = { "API_KEY": "'you've just exposed your secret_key'"
}
class User: name = "" email = "" def __init__(self, name, email): self.name = name self.email = email def __str__(self): return self.name if __name__ == '__main__': name = input() email = input()
The benefits of buying summaries with Stuvia:
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
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
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 EvaTee. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $13.99. You're not tied to anything after your purchase.