[ create a new paste ] login | about

Link: http://codepad.org/V5pFFleC    [ raw code | output | fork ]

Python, pasted on Jul 22:
1
2
3
4
5
6
7
8
9
10
age = 25

if age < 4:
 price = 0
elif age < 18:
 price = 5
else:
 price = 10

print("Your cost of admission is $"+price+".")


Output:
1
2
3
4
Traceback (most recent call last):
  Line 10, in <module>
    print("Your cost of admission is $"+price+".")
TypeError: cannot concatenate 'str' and 'int' objects


Create a new paste based on this one


Comments: