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 03:40
Mary's manager told her she should insert a graphic into her documentwrite mary a brief note describing how to insert a graphicin a word processing document.
Answers: 1
question
Computers and Technology, 22.06.2019 23:30
What is the digital revolution and how did it change society? what are the benefits of digital media?
Answers: 1
question
Computers and Technology, 23.06.2019 02:30
What is the power dissipated by a resistor with a current of 0.02 a and a resistance of 1,000 ? a. 200 w b. 20 w c. 0.4 w d. 4 w
Answers: 1
question
Computers and Technology, 23.06.2019 10:00
Hey i just logged on and one of the moderators deleted a bunch of my answers to questions, even though the answers were right and the people it doesn't make sense but if anyone wants to talk about anything just message me lol (this is super random lol)
Answers: 1
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, 10.12.2020 20:20
question
Mathematics, 10.12.2020 20:20
question
Mathematics, 10.12.2020 20:20
question
Mathematics, 10.12.2020 20:20
Questions on the website: 13722361