are these operations on list valid?
Ken
ken at hotmail.com
Sat Oct 5 23:11:33 EDT 2002
More information about the Python-list mailing list
Sat Oct 5 23:11:33 EDT 2002
- Previous message (by thread): are these operations on list valid?
- Next message (by thread): are these operations on list valid?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
By the way....same type of question for dictionary..... Thanks "Ken" <ken at hotmail.com> wrote in message news:ano9fi$fo0ko$1 at ID-49758.news.dfncis.de... > Hi, just like to know if these are valid: > > 1: > Use: > var1 = "hello" > var2 = "world" > list = [var1, var2] > > Instead of: > list = [] > list.append(var1) > list.append(var2) > -------------------- > 2. > Use: > list=["hello", "world"] > if list==["hello", "world]: #comparing list with list without examining > through every element inside > do something..... > > Instead of: > list1=["hello", "world"] > if list[0]==list1[0] and list[1]==list1[1]: > do something.... > --------------------- > Thanks > > > >
- Previous message (by thread): are these operations on list valid?
- Next message (by thread): are these operations on list valid?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list