Posts

Showing posts from December, 2018

Top Five Things To Safe Yourself On Internet

Image
1) Create Unique And Strong Password: We know you’ve heard it before, but creating  strong, unique passwords  for all your critical accounts really is the best way to keep your personal and financial information safe. And this is only way to keep your data safe and secure. 2) Use A Firewall In Your pc: Even if your network is secure, you should still use a firewall. This an electronic barrier that blocks unauthorized access to your computers and devices, and is often included with  comprehensive security software . Using a firewall ensures that all of the devices connected to your network are secured, including Internet of Things (IoT) devices like smart thermostats and webcams. This is important since many IoT devices aren’t equipped with security measures, giving hackers a vulnerable point of entry to your entire network. 3) Keep Up To Date: Keep all your software updated so you have the latest security patches. Turn on automatic updates so ...

Learn to Program: The Fundamentals — Week 3 Exercise Answers

Image
Learn to Program: The Fundamentals — Week 3 Exercise Score of  16.00  out of  16.00 . You should run any code that you are unsure of, in IDLE or in the Python Visualizer (or both). Question 1 Variable  dollars  refers to the value  8 . Select the expression(s) that produce  True . Your Answer Score Explanation 8 >= dollars Correct 0.25 dollars != 8 Correct 0.25 8 = dollars Correct 0.25 dollars == 8.0 Correct 0.25 Total 1.00 / 1.00 Question Explanation The equality operator is  == , and the assignment operator is  = . When the equality operator ( == ) is applied to  int  value  8  and  float  value  8.0 , the two values are considered equivalent. Question 2 Variable  instructors  refers to the value  2 . Select the expression(s) that produce  True . Your Answer Score Explanation not not instructors >= -3 Correct 0.25 not instructors * 2 > 1 Co...

Learn to Program: The Fundamentals — Week 2 Exercise Answers

Image
Learn to Program: The Fundamentals — Week 2 Exercise Score of  17.00  out of  18.00 . Answer the following questions. Some of the questions will require you to run code in IDLE's Python shell. (You should do this anyway to get used to using IDLE.) Question 1 Which of the following results in a  SyntaxError ? Your Answer Score Explanation  '''yes no''' Correct 0.25  "yes no" Correct 0.25  'yes\nno' Correct 0.25  'yes no' Correct 0.25 Total 1.00 / 1.00 Question Explanation Try typing each option exactly as it appears into IDLE, paying particular attention to newlines. Copying and pasting might not work, so if you're frustrated, try typing them out. Make sure you understand why each one does what it does! Question 2 Which of the following results in a  SyntaxError ? Your Answer Score Explanation '"Once upon a time...", she said.' Correct 0.25 "He said, "Yes!"...

Learn to Program: The Fundamentals - Week 6 Exercise Answers

Learn to Program: The Fundamentals - Week 6 Exercise Score of  13.00  out of  13.00 .  Open up IDLE and try out all the code as you do the exercise! Question 1 Consider this code: def merge(L): merged = [] for i in range(0, len(L), 3): merged.append(L[i] + L[i + 1] + L[i + 2]) return merged print(merge([1, 2, 3, 4, 5, 6, 7, 8, 9])) What is printed by the code above? Your Answer Score Explanation [123, 456, 789] [1, 4, 7] [6, 15, 24] Correct 1.00 [12, 15, 18] Total 1.00 / 1.00 Question Explanation Trace the code by hand or in the visualizer, or run the code in IDLE. Question 2 Consider this code: def mystery(s): """ (str) -> bool """ matches = 0 for i in range(len(s) // 2): if s[i] == s[len(s) - 1 - i]: # <-- How many times is this line reached? matches = matches + 1 return matches == (len(s) // 2) mystery('civil') Trace the function call...