Python Forum
Problem with "while and a string of characters
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with "while and a string of characters
#3
Okay, thanks but with this :

ligne1 = [2,0,5,5,1,4,4,2,1,3,5,3,2,4,2,1,4,4]                 
ligne2 = [0,0,0,5,1,3,1,2,2,5,3,2,4,4,1,3,5,2]
ligne3 = [3,0,3,0,4,5,0,1,0,4,3,1,0,3,5,2,5,1]

def facejaune90(ligne1,ligne2,ligne3):         
   m = ligne1[6]
   ligne1[6] = ligne3[6]
   ligne3[6] = ligne3[8]
   ligne3[8] = ligne1[8]
   ligne1[8] = m
   m = ligne1[7]
   ligne1[7] = ligne2[6]
   ligne2[6] = ligne3[7]
   ligne3[7] = ligne2[8]
   ligne2[8] = m
   m = ligne3[3]
   ligne3[3] = ligne1[17]
   ligne1[17] = ligne1[11]
   ligne1[11] = ligne3[12]
   ligne3[12] = m
   m = ligne3[4]
   ligne3[4] = ligne1[16]
   ligne1[16] = ligne1[10]
   ligne1[10] = ligne3[13]
   ligne3[13] = m
   m = ligne3[5]
   ligne3[5] = ligne1[15]
   ligne1[15] = ligne1[9]
   ligne1[9] = ligne3[14]
   ligne3[14] = m
   return ligne1,ligne2,ligne3

while (ligne1[8]!=4 and ligne3[5]!=1 and ligne3[12]!=0):
   ligne1,ligne2,ligne3 = facejaune90(ligne1,ligne2,ligne3)
   print("recherche en cours...")
print(ligne1)
print(ligne2)
print(ligne3)
The program not going in the "while". Why ? The conditions are true, so he must go inside. I don't understand...
Reply


Messages In This Thread
RE: Problem with "while and a string of characters - by Faosry - Nov-08-2017, 11:07 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  doing string split with 2 or more split characters Skaperen 22 2,745 Aug-13-2023, 01:57 AM
Last Post: Skaperen
  How do I check if the first X characters of a string are numbers? FirstBornAlbratross 6 1,615 Apr-12-2023, 10:39 AM
Last Post: jefsummers
  Convert string to float problem vasik006 8 3,515 Jun-03-2022, 06:41 PM
Last Post: deanhystad
Question [SOLVED] Delete specific characters from string lines EnfantNicolas 4 2,303 Oct-21-2021, 11:28 AM
Last Post: EnfantNicolas
  f string concatenation problem growSeb 3 2,317 Jun-28-2021, 05:00 AM
Last Post: buran
Question Problem with string and \n Falassion 6 2,763 Jun-15-2021, 03:59 PM
Last Post: Falassion
  Extract continuous numeric characters from a string in Python Robotguy 2 2,701 Jan-16-2021, 12:44 AM
Last Post: snippsat
  how to deal with problem of converting string to int usthbstar 1 2,033 Jan-05-2021, 01:33 PM
Last Post: perfringo
  Python win32api keybd_event: How do I input a string of characters? JaneTan 3 3,909 Oct-19-2020, 04:16 AM
Last Post: deanhystad
  string problem Mathisdlg 6 2,945 Aug-05-2020, 09:31 AM
Last Post: Mathisdlg

Forum Jump:

User Panel Messages

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