amgrima58 at gmail.com
Thu Mar 5 16:39:03 CET 2015
I have not received a response from you. However, I think I know what the
problem is. My laptop is XP (important in terms of programming in
mathematics and science for obvious reasons). However, my operating system
is Professional only - no XP. It doesn't seem to make a difference in most
situations, but it is unable to read the decimal point in as a string
variable in Python. It reads it as a literal and therefore it is unable to
change to a floating number. In other words, Python does not have the
ability to change the "." into an equivalent decimal point in the system
that I have. But please note, that the underlying assumption here is that
Python is able to do so in an XP system.
On Tue, Feb 24, 2015 at 4:24 PM, Angela Grima <amgrima58 at gmail.com> wrote:
> I am a beginner at Python and I am trying to write a program that allows
> me to read in a list of decimal numerals, assign a grade to each one, and
> write each one with the corresponding grade. Unfortunately, it Python
> thinks that each score is a string but does not allow me to convert it to a
> floating point. I have tried different statements using Python but I am
> still stuck. Attached are a copy of the program, data being used. Below
> is the printed output.
> Microsoft Windows [Version 6.1.7601]
> Copyright (c) 2009 Microsoft Corporation. All rights reserved.
> C:\Users\Ange\Documents\Computer Science\Python Class>docbright.py
> Score Grade
> Traceback (most recent call last):
> File "C:\Users\Ange\Documents\Computer Science\Python
> Class\docbright.py", lin
> e 18, in <module>
> x = float(x) + .005
> ValueError: could not convert string to float:ss>
> Your help is appreciated.
> Angela Grima
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the docs