5. (5%) Write a Python code fragment that swaps the values of the variables A an
ID: 3570055 • Letter: 5
Question
5. (5%) Write a Python code fragment that swaps the values of the variables A and B (that is, the value of A become the value of b, and the value of B becomes the value of A). 6. (5%) Write a Python code fragment that prompts the user to enter a number and then prints the square root of that number. Do not import any modules. 7. (8%) Write a Python rode fragment that prompts the user to enter a string and then prints the entered string with the prefix 'a ' (less the quotes) and suffix 'er' (less the quotes). For example, if I enter 'sell', your code shall print 'a seller'.Explanation / Answer
5)
temp = a
a = b
b = temp
6)
num = int(raw_input())
print num**0.5
7)
str = raw_input()
print 'a'+str+'er'
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.