Please answer all of them I really need it 1) Miranda has forgotten to complete
ID: 3756891 • Letter: P
Question
Please answer all of them I really need it
1) Miranda has forgotten to complete an arithmetic expression before the end of a line of code. How will the Python interpreter react?
2) Suppose your script attempts to print the value of a variable that has not yet been assigned a value. How does the Python interpreter react?
3) Write a line of code that prompts the user for his or her name and saves the user's input in a variable called name.
4) Describe what happens when the programmer enters the string "Greetings!" in the Python shell.
5) List three common types of computing agents.
Explanation / Answer
1) Miranda has forgotten to complete an arithmetic expression before the end of a line of code. How will the Python interpreter react? Answer: we can not have an arithmetic expressions in more than one line. so, interpreter will throw an error if we don't end the line with a so, a = 2 + 3 - 4 The above expression in more than one line will work. but, a = 2 + 3 - 4 The above expression in more than one line will not work. 2) Suppose your script attempts to print the value of a variable that has not yet been assigned a value. How does the Python interpreter react? Answer: The interpreter will give a NameError error. 3) Write a line of code that prompts the user for his or her name and saves the user's input in a variable called name. name = input('Enter your name: ') 4) Describe what happens when the programmer enters the string "Greetings!" in the Python shell. Answer: It will print 'Greetings!' string on console.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.