what is new with int conversion in Python 3

Steven D'Aprano steve at pearwood.info
Sun May 22 03:55:27 EDT 2016


On Sun, 22 May 2016 05:26 pm, Sayth Renshaw wrote:

> I am doing a passage in a book that was written for python 2 i am writing
> everything in 3.
[...] 
> However when I run this I get a valuerror. So either something has changed
> with int or datetime I cannot google a consistent answer.

Neither. It will help if you read the error message:


> ValueError: invalid literal for int() with base 10: '-f'

You're passing -f as the first argument to the script, instead of an
integer. Look at the command you are typing. My guess is that you are
typing something like

python vectorsum.py -f 27

instead of 

python vectorsum.py 27


-- 
Steven




More information about the Python-list mailing list