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?

Respuesta :

ACCESS MORE