subject

Critical Thinking QuestionsIn this unit, you used this code to ensure that the user would enter a number and not letters:while True: try: num = int(input("Enter your age: ")) break except ValueError: print("That's not a number!")How could you modify this code to be sure that the user enters a positive number?You are writing a program in JavaScript that asks users to input their grade level. You want to check for errors and give the users an error message if they 1) enter a blank, 2) enter letters instead of numbers, or 3) enter a number greater than 12. What would the pseudocode look like for a function that would check these things?In this lesson, you learned that the five most common Python errors are incorrect indentation, count errors in loops, confusion of single and double equal signs, punctuation errors, and spelling errors. Based on your own programming experience, what are some other common errors? What are some things that you can do to avoid or easily catch those errors?You are creating a function that will test whether a number is greater than 10 using these lines of code:if a < 10: print(a "is greater than 10")Can you identify one syntax error and one logic error in these lines? Why do you think a programmer might have made the logic error?You are creating a program in which the user will input his or her age. The program will calculate the year that the user was born and will then tell the user which decade he or she was born in. Here is part of the code:if year > 1989 and year < 2000 print("You were born in the 1980s")Can you identify one syntax error and one logic error in these lines? How do you think you could avoid making logic errors like the one in this code?

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 04:50
Which are steps taken to diagnose a computer problem? a) reproducing the problem and using error codes b) reproducing the problem and troubleshooting c) using error codes and troubleshooting d) using error codes and stepping functions
Answers: 1
question
Computers and Technology, 22.06.2019 19:30
When using a public computer or network, you should always
Answers: 2
question
Computers and Technology, 23.06.2019 06:30
You are consulting for a beverage distributor who is interested in determining the benefits it could achieve from implementing new information systems. what will you advise as the first step?
Answers: 1
question
Computers and Technology, 23.06.2019 08:30
Helen's credit card has an apr of 15.32% and a grace period of 17 days and helen pays her balance in the full every month. if her last billing cycle ended on september 26, 2009, and she made her payment on october 11, 2009, did she owe any interest on her last statement's balance?
Answers: 3
You know the right answer?
Critical Thinking QuestionsIn this unit, you used this code to ensure that the user would enter a nu...
Questions
question
Mathematics, 06.10.2020 22:01
question
Mathematics, 06.10.2020 22:01
question
Mathematics, 06.10.2020 22:01
Questions on the website: 13722363