Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

  1. You can use Counter if you want to do multiple count of the list from collections import Counter list = ['Jones','Adams','Frank','John','Lopez','Jones','Smith','Ivan','Julian','Carlos','Adams','Frank','Jones','John','Ivan'] print(Counter(list)) Result: Counter({'Jones': 3, 'Adams': 2, 'Frank': 2, 'JRead more

    You can use Counter if you want to do multiple count of the list

    Result:

     

    See less
  2. Hi, to remove duplicates from the list you can add this line before printing the list: my_list = list(dict.fromkeys(my_list)) best regards  

    Hi,

    to remove duplicates from the list you can add this line before printing the list:

    best regards

     

    See less
  3. Follow this example to create a variable outside functions, and use it inside the functions: MyVariable = 99 #this is a global variable def changeAndPrint_GlobalVariable(): global MyVariable #use global variable in this function with "global" keyword print('Global variable "MyVariable" before changeRead more

    Follow this example to create a variable outside functions, and use it inside the functions:

    This code will print:

     

    See less
  4. Hello this code may help you: def flatten_list(original_List): flat_list = [] for sub_list in original_List: for element in sub_list: flat_list.append(element) return flat_list #test original_List=[['a', 'b', 'c', 'd','e'], ['f', 'g', 'h', 'i'], ['j', 'k', 'l'], ['m', 'n', 'o']] print('original listRead more

    Hello

    this code may help you:

     

    See less