relopfiber.blogg.se

Write python online
Write python online








If the index is greater than or equals zero, slice the lists into two parts and store the concatenated string with the right part added first in order. Until the letters in the result list are not zero, store the index value from where you have to perform the slicing. Ret_list = remove_match_char(p1_list, p2_list) Find the index of the asterisk you inserted and slice the strings into two lists before and after it.Ĭount the number of characters in the two lists and define a list that stores the various status a relationship can have as per the FLAMES game. Store the concatenated list and the flag status received from the function. Until the value of proceed is true, call the remove_match_char() function and pass the two lists you just created. Repeat this with the name of the second person and set the proceed variable to True.

write python online

Convert the name into a list of characters. Convert all the letters to lowercase and eliminate any spaces in between. Retrieve the name of the person the user entered using the get() method on the Entry widget. from tkinter import *ĭefine a function, tell_status(). In case no letters match, return the list as created above. Return the third list along with the match found as True. Check if there’s a matching character if there is, remove it from both lists and create a third list that concatenates both lists with an asterisk in between. Use a nested for loop to iterate over both lists.

write python online

Define a function, remove_match_char() that accepts two lists as input. You can find the source code of the FLAMES game using Python in this GitHub repository.










Write python online