ValueError at /add/
invalid literal for int() with base 10: '‘6’'
Request Method: | GET |
---|---|
Request URL: | http://127.0.0.1:8000/add/?a=6&b=%E2%80%986%E2%80%99 |
Django Version: | 1.11 |
Exception Type: | ValueError |
Exception Value: |
invalid literal for int() with base 10: '‘6’' |
Exception Location: | D:hackPython我的学习Djangoweb1calcviews.py in add, line 6 |
Python Executable: | C:Usersjumz-GAppDataLocalProgramsPythonPython35-32python.exe |
Python Version: | 3.5.0 |
Python Path: |
['D:\hack\Python\我的学习\Django\web1', 'C:\Users\jumz-G\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django-1.11-py3.5.egg', 'C:\Users\jumz-G\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pytz-2016.10-py3.5.egg', 'C:\Users\jumz-G\AppData\Local\Programs\Python\Python35-32\python35.zip', 'C:\Users\jumz-G\AppData\Local\Programs\Python\Python35-32\DLLs', 'C:\Users\jumz-G\AppData\Local\Programs\Python\Python35-32\lib', 'C:\Users\jumz-G\AppData\Local\Programs\Python\Python35-32', 'C:\Users\jumz-G\AppData\Local\Programs\Python\Python35-32\lib\site-packages'] |
Server time: | Sat, 24 Dec 2016 11:08:55 +0000 |
他是这么报错的
我们穿的值是6和‘6’!
但是在我们的代码里面 都会把它int()
c=str(int(a)*int(b))