+ 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)4 odpowiedzi
+ 2
print("Total:", "quot;+str(b))
+ 1
Try this as input (each element separated by a space):
42 42 31
+ 1
If you want to directly convert the user input into int value u can use this expression
a=int(input('Enter the expenses'))
+ 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)