Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it?

William Bryant gogobebe2 at gmail.com
Sat Sep 21 02:07:57 EDT 2013


On Saturday, September 21, 2013 1:39:41 AM UTC+12, Duncan Booth wrote:
> William Bryant <gogobebe2 at gmail.com> wrote:
> 
> 
> 
> > Thanks a lot! I have one more question, is there any way I can make my
> 
> > program work on android tablets and ipads? Because I'd like to use it
> 
> > in school because we are learning statistics and we are allowed our
> 
> > devices in school. 
> 
> > 
> 
> 
> 
> You can install SL4A on Android and that should let you run your script on 
> 
> an Android tablet. You may want to modify the script to work with the 
> 
> android UI, or it might be enough just to run it in a terminal window.
> 
> 
> 
> I don't believe there is an ipad equivalent, but so long as you have a 
> 
> network connection, another option to consider (that would work on both 
> 
> android and ipad) would be to run the script on a server somewhere and 
> 
> connect to it through a web browser. Have a look at https://c9.io as that 
> 
> gives you a full development environment that can be accessed through a web 
> 
> browser: I don't know how well it works on a tablet but it would be worth 
> 
> trying.
> 
> 
> 
> 
> 
> -- 
> 
> Duncan Booth http://kupuguy.blogspot.com

Ok thanks for that, I know I said one more question, but could you pleasse help me here:

def median():
    medlist = List
    medlist.sort()
    if len(medlist) % 2:
        while len(medlist) > 2:
            medlist.popleft()
            medlist.popright()
        if medlist[0] == medlist[1]:
            themedian = medlist
        elif medlist[0] != medlist[1]:
            #make an if statment to figure out the median if the last 2 left are not the same. Eg [1, 2] the middle value is 1.5
            pass
    else:
        while len(medlist) > 1:
            medlist.popleft()
            medlist.popright()
        themedian = medlist
    return themedian

It says out of range and i don't know how I am going to make an if statment to figure out the median if the last 2 left are not the same. Eg [1, 2] the middle value is 1.5. Thanks - I am 13 year old beginner in python and i am trying to finish the tutorial on code academy and read the docs. :)



More information about the Python-list mailing list