Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Generate Cartesian Products with Itertools Incrementally
Post: RE: Generate Cartesian Products with Itertools Inc...

I actually figured it out. incremental_append = [] for characterSet in (a,b): incremental_append.append(char) for result in itertools.product(*incremental_append): print(result)Thank...
CoderMan General Coding Help 2 1,856 Jun-04-2020, 04:51 PM
    Thread: Generate Cartesian Products with Itertools Incrementally
Post: Generate Cartesian Products with Itertools Increme...

Hello, I know I can get Cartesian products using itertools.product(a,b)Assuming that a = ['a','b'] and b = ['1','2'] the result would be (a1,a2,b1,b2). How can I get the result (a,b,a1,a2,b1,b2)? Th...
CoderMan General Coding Help 2 1,856 Jun-04-2020, 03:12 PM
    Thread: Problem with 'and' in 'if' statement
Post: RE: Problem with 'and' in 'if' statement

(Oct-02-2019, 10:20 AM)buran Wrote: Yes, you are using and wrong Look at https://docs.python.org/3/library/stdtyp...ue-testing 'A' and 'B' and 'C' in x is same as True and True and 'C' in x def che...
CoderMan General Coding Help 3 2,538 Oct-06-2019, 07:12 PM
    Thread: How i can judge my code
Post: RE: How i can judge my code

Are you trying to know the position of all the 1s in your string or how many ones there are in your string?
CoderMan General Coding Help 16 5,909 Oct-02-2019, 09:24 AM
    Thread: Problem with 'and' in 'if' statement
Post: Problem with 'and' in 'if' statement

Hello, I'm trying to make a function that returns true if a list contains at least one of many predetermined letters in it. The code is as follows: def check(x): if 'A' and 'B' and 'C' in x: ...
CoderMan General Coding Help 3 2,538 Oct-02-2019, 09:14 AM
    Thread: __init__ function arguments
Post: RE: __init__ function arguments

(Jan-18-2019, 01:58 PM)Larz60+ Wrote: the statement: x = item(10,item.v1/2)is outside of the class, so cannot see v1 or v2 this script is not worthy of a class, but: better to use inside of a funct...
CoderMan General Coding Help 4 3,051 Jan-27-2019, 04:09 AM
    Thread: __init__ function arguments
Post: __init__ function arguments

Hello, I am trying to make an __init__ function's argument be the previous argument of that function divided by 2. class item: def __init__(self,value1,value2): self.v1 = value1 ...
CoderMan General Coding Help 4 3,051 Jan-18-2019, 12:41 PM
    Thread: A Learning Neural Network (?)
Post: Updated Simplified Code

Here is a simplified version of the code: import random num1 = random.randint(0,1) if num1 == 0: num2 = 1 elif num1 == 1: num2 = 0 class neuron: def __init__(self,value,inW): ...
CoderMan General Coding Help 1 2,231 Oct-10-2018, 12:54 AM
    Thread: A Learning Neural Network (?)
Post: A Learning Neural Network (?)

I've recently got interested in Neural Networks, and I wanted to try and create one using Python. I am not very advanced with Python, I just know the basic stuff. I also don't think I have totally und...
CoderMan General Coding Help 1 2,231 Oct-09-2018, 04:39 PM

User Panel Messages

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