Thread: Need help

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    6
    Rep Power
    0

    Need help


    Hello
    i am noob at python and i need to do this qustion

    Input 10 positive integers. Output the sum of the integers input in the even places (second, fourth,) (isumevenplace). Output the sum of the integers input in the odd places ( first, third,) (isumoddplace).


    and i need to flowchart but this is the bigest problem
    i cant understand this staff can some one explain me please
    thank alot
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,905
    Rep Power
    481
    Please investigate the sum function

    Indexing an array (for example, objects from odd indexes of a list are LIST[1::2])

    list class

    You'll need a way to prompt for data. The usual answer with the input function might differ depending on the version of python you use. How much error testing do you want? What if the user mistypes an invalid number? Handling user input consumes a large fraction of the total programming effort.

    If you thought of a way to solve the problem without lists that's ok too---probably more efficient. The nice thing about lists is you'll have the data in memory for re-use.
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo