How would I pass something from a driver into a list inside a class. I then need remove a word from the list and replace it with a new word.
Ghostenshell
0
Light Poster
Recommended Answers
Jump to PostYou are mixing strings and lists. This should help.
class Sentence: def __init__(self, astr="I'm going back"): self.astr = astr def setWord(self, astr): self.astr=astr def getfirstword(self): return ' Changer the word back', self.astr[2] def getallword(self): print "astr[2]", self.astr[2] astr_list = self.astr.split() print "astr_list[2]", astr_list[2] astr_list[2] = "XXX" print …
All 4 Replies
woooee
814
Nearly a Posting Maven
Ghostenshell
0
Light Poster
woooee
814
Nearly a Posting Maven
Ghostenshell
commented:
Thanks again.
+2
griswolf
304
Veteran Poster
Ghostenshell
commented:
Thank you.
+2
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.