+ 1

how can i make output like (Total: $115)

a = input("Enter the expenses: ") a = a.split() b = 0 y = '

#x27; for i in a: b = b + int(i) print("Total:","
quot;,+b)

28th Jun 2019, 4:04 PM
Khalid Saud
Khalid Saud - avatar
4 odpowiedzi
+ 2
print("Total:", "
quot;+str(b))
28th Jun 2019, 5:04 PM
Diego
Diego - avatar
+ 1
Try this as input (each element separated by a space): 42 42 31
28th Jun 2019, 4:10 PM
Diego
Diego - avatar
+ 1
If you want to directly convert the user input into int value u can use this expression a=int(input('Enter the expenses'))
28th Jun 2019, 4:36 PM
Reality Hacker
Reality Hacker - avatar
+ 1
Try this as input (each element separated by a space): 42 42 31 ================= I have already entered numbers with space i want the result like(Total: $115)
28th Jun 2019, 5:01 PM
Khalid Saud
Khalid Saud - avatar