Insert, vary basic issue
Author |
Message |
RyGuy-Anime
|
Posted: Sun Feb 05, 2012 2:18 pm Post subject: Insert, vary basic issue |
|
|
i am just learning python and am unable to grasp the error in my programming because i literally just started learning, i tried to manipulate a list in python 3 and i am getting an attribute error on the insert command :/ please help
Description: |
this is the problem i had in IDLE |
|
Filesize: |
7.17 KB |
Viewed: |
11867 Time(s) |
|
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
Insectoid
|
Posted: Sun Feb 05, 2012 2:33 pm Post subject: RE:Insert, vary basic issue |
|
|
A list is in square brackets. Round brackets denote a tuple (I assume).
Try comp = ["ryan, 1, "zaid", 2, "peter", 3]
|
|
|
|
|
|
RyGuy-Anime
|
Posted: Sun Feb 05, 2012 2:35 pm Post subject: Re: Insert, vary basic issue |
|
|
YOU SIR are a life saver !!!!
|
|
|
|
|
|
Velocity
|
Posted: Fri Feb 10, 2012 3:58 pm Post subject: RE:Insert, vary basic issue |
|
|
lol you never tryed to solve it? didnt you read the turing post assist? "What have you done to try and solve this problem"? ? Insectoid, thanks alot for helping him.
|
|
|
|
|
|
[Gandalf]
|
Posted: Fri Feb 10, 2012 8:24 pm Post subject: RE:Insert, vary basic issue |
|
|
Velocity, stop. Really, stop. This is the Python forum, there is no Turing Help post template...
RyGuy-Anime: The main difference between tuples and lists is that tuples are immutable (they can't be modified after being initialized) while lists are mutable (you can add and remove elements freely). That's also why your immutable tuple doesn't have a method to insert.
|
|
|
|
|
|
|
|