Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: How to split a string containing function calls?
Post: RE: How to split a string containing function call...

I believe I have found the answer to my problem: regular expressions. Remember I said if there was a way to look for all expressions in form add/multiply(int,int) and replace with value? I found out t...
Metalman488 General Coding Help 4 2,896 Oct-27-2018, 06:50 PM
    Thread: How to split a string containing function calls?
Post: RE: How to split a string containing function call...

Can anyone give me any suggestions? I'm playing with it a bit, but all I've gotten so far is to take the example: add(add(2,2),add(3,3)) and do this: st = "add(add(2,2),add(3,3))" print(st[st.find('(...
Metalman488 General Coding Help 4 2,896 Oct-27-2018, 12:16 AM
    Thread: How to split a string containing function calls?
Post: RE: How to split a string containing function call...

What I'm trying to do at the moment is split the strings I get in the following examples: add(add(1,2),3) #This one I can already do somewhat. Its infix equivalent is (1+2)+3 multiply(add(1,1),add(2,2...
Metalman488 General Coding Help 4 2,896 Oct-25-2018, 02:47 PM
    Thread: How to split a string containing function calls?
Post: How to split a string containing function calls?

So I am working on a program that takes function calls like: add(2,2) multiply(1,2) add(add(2,2),6) multiply(add(add(1,3),2),3) add(add(2,2),add(1,1)) My current code can solve the first 2 just fine ...
Metalman488 General Coding Help 4 2,896 Oct-24-2018, 01:00 AM
    Thread: Help on adding two lists recursively
Post: RE: Help on adding two lists recursively

so I applied my eqSize function and the result I get from adding these two lists: list1 = ["123", "001", "234", "567"] list2 = ["007", "894", "561"] is ['124', '009', '129', '128'] which is almost co...
Metalman488 General Coding Help 3 4,180 Sep-16-2018, 08:10 PM
    Thread: Help on adding two lists recursively
Post: RE: Help on adding two lists recursively

(Sep-16-2018, 04:36 PM)gontajones Wrote: def recursive_sum(l1, l2, idx=0, carryout=0): if idx < min(len(l1), len(l2)): l1 = l1[::-1] l2 = l2[::-1] n = int(l1[idx]) + i...
Metalman488 General Coding Help 3 4,180 Sep-16-2018, 07:09 PM
    Thread: Help on adding two lists recursively
Post: Help on adding two lists recursively

So I have two lists that are each a large integer that has been split up into nodes. (Example: 123456 => [123,456]) and I need to add two lists like that, so something like [123,456]+[789,654] This...
Metalman488 General Coding Help 3 4,180 Sep-16-2018, 03:17 PM

User Panel Messages

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