how to search for a capital letter within a string and return the list of words with and without capital letters

前端 未结 9 1200
无人共我
无人共我 2020-12-18 23:23

My homework assignment is to Write a program that reads a string from the user and creates a list of words from the input.Create two lists, one containing the words that con

9条回答
  •  盖世英雄少女心
    2020-12-18 23:46

    My regex:

    vendor  = "MyNameIsJoe. IWorkInDDFinc."
    ven = re.split(r'(?<=[a-z])[A-Z]|[A-Z](?=[a-z])', vendor)
    

    I need split word that would have happened: My Name Is Joe. I Work In DDF inc.

提交回复
热议问题