Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: How to iterate over some characters in a string and the others will stay as it is. ?
Post: RE: How to iterate over some characters in a strin...

(Jun-17-2019, 02:15 PM)ThomasL Wrote: In your initial post you wrote: Quote:How about do I want ? one and two one and t one and w one and o o and two o and t o and w o and o n and two n and t n and...
sodmzs General Coding Help 9 4,431 Jun-17-2019, 03:19 PM
    Thread: How to iterate over some characters in a string and the others will stay as it is. ?
Post: RE: How to iterate over some characters in a strin...

(Jun-17-2019, 10:16 AM)noisefloor Wrote: Hi, @sodmzs: iterating with range(len(..)) and the index over an iterable is an anti-pattern, don't do it. Python support direct iteration: >>> on...
sodmzs General Coding Help 9 4,431 Jun-17-2019, 12:16 PM
    Thread: How to iterate over some characters in a string and the others will stay as it is. ?
Post: How to iterate over some characters in a string an...

one = ["one","o","n","e"] two = ["two","t","w","o"] t = "one and two" dict = dict(one = one, two = two) words = ["one","and","two"] for i in range(0,len(dict)): for j in range(0,len(words)): ...
sodmzs General Coding Help 9 4,431 Jun-17-2019, 07:29 AM
    Thread: how to get all the possible permutation and combination of a sentence in python
Post: how to get all the possible permutation and combin...

Hi, I have a text say for example, t = "life is amazing" by doing, from nltk.tokenize import word_tokenize words = word_tokenize(t) what I got, >>>words = ["life","is","amazing"] an...
sodmzs General Coding Help 1 4,179 Jun-13-2019, 06:53 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020