Write a shell (text-based) program, called sum_num.py, that asks the user for a
ID: 3589887 • Letter: W
Question
Write a shell (text-based) program, called sum_num.py, that asks the user for a semicolon (;) separated list of numbers, and calculated the total. See the example below.
C Secure ! https://ggc-view.usg.edu/content/enforced/1 318825-CO.400.1TEC2120.801 37.20182/asgs/shell-asg9.html Sum Num Write a shell (text-based) program, called sum_num py, that asks the user for a semicolon (:) separated list of numbers. and calculated the total. See the example below PS C:UsersssivalDesktop> python sum_num.py Enter semicolon separated list of integers: 3;104;23;211;3 The total is 254 PS C:UsersssivaDesktop> Submit the file sum num.py when done. Hint: Use the string spiro finction. O Type here to search 12-15 PM 010/2017Explanation / Answer
sum = 0
print "Enter string seperated by ; containing integers:"
string = raw_input()
stringSeperated = string.split(';')
for x in stringSeperated:
sum = sum + int(x)
print(' The total is ')
print(sum)
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.