Python Forum
Simple Function Problem, please help
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple Function Problem, please help
#14
When the user enters a column, the correct position is taken in the list.

The function that changes the string:
def insertChar(mystring, position, chartoinsert ):
    mystring=mystring[:position-1]+chartoinsert+mystring[position:]
    return mystring
The calling of that function:
dboard[columncheck(column)]=insertChar(dboard[columncheck(column)],(4*column)-1,counter)
Counter is literally the counter(X or O)

I have edited the function, and the 'gravity' now works. Thanks for the help works.

If an admin could delete this post, that would be appreciated! Big Grin LOL
Reply


Messages In This Thread
RE: Simple Function Problem, please help - by mpd - Dec-28-2017, 02:43 AM
RE: Simple Function Problem, please help - by mpd - Jan-02-2018, 01:50 PM
RE: Simple Function Problem, please help - by ShadowWarrior17 - Jan-02-2018, 10:44 PM
RE: Simple Function Problem, please help - by mpd - Jan-02-2018, 11:11 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  A simple problem, how best to solve it? SuchUmami 2 760 Sep-01-2023, 05:36 AM
Last Post: Pedroski55
  How to solve this simple problem? Check if cvs first element is the same in each row? thesquid 2 1,293 Jun-14-2022, 08:35 PM
Last Post: thesquid
Big Grin question about simple algorithm to my problem jamie_01 1 1,716 Oct-04-2021, 11:55 AM
Last Post: deanhystad
  simple login problem MMOToaster 2 2,448 Feb-25-2020, 09:28 AM
Last Post: MMOToaster
  got SyntaxError while building simple function zarize 2 2,166 Feb-14-2020, 10:51 AM
Last Post: zarize
  Problem with simple 3D Vektor calculation Pythocodras 0 1,738 Dec-11-2019, 07:18 PM
Last Post: Pythocodras
  Simple statistics with range function Pythonlearner2019 2 2,168 Nov-25-2019, 05:25 PM
Last Post: Pythonlearner2019
  Simple problem. looking for an efficient way silverchicken24 3 2,387 Oct-14-2019, 07:13 PM
Last Post: Larz60+
  Cannot get simple i/o to function. jerryi 10 6,805 Jul-27-2019, 06:22 PM
Last Post: jerryi
  simple string & input problem kungshamji 5 3,730 Jun-23-2019, 03:54 PM
Last Post: kungshamji

Forum Jump:

User Panel Messages

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