久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<legend id='hyVrZ'><style id='hyVrZ'><dir id='hyVrZ'><q id='hyVrZ'></q></dir></style></legend>

  • <small id='hyVrZ'></small><noframes id='hyVrZ'>

    <i id='hyVrZ'><tr id='hyVrZ'><dt id='hyVrZ'><q id='hyVrZ'><span id='hyVrZ'><b id='hyVrZ'><form id='hyVrZ'><ins id='hyVrZ'></ins><ul id='hyVrZ'></ul><sub id='hyVrZ'></sub></form><legend id='hyVrZ'></legend><bdo id='hyVrZ'><pre id='hyVrZ'><center id='hyVrZ'></center></pre></bdo></b><th id='hyVrZ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='hyVrZ'><tfoot id='hyVrZ'></tfoot><dl id='hyVrZ'><fieldset id='hyVrZ'></fieldset></dl></div>
      • <bdo id='hyVrZ'></bdo><ul id='hyVrZ'></ul>
      <tfoot id='hyVrZ'></tfoot>

        如何僅將列表中每個字符串的標題大寫?

        How to capitalize only the title of each string in the list?(如何僅將列表中每個字符串的標題大寫?)
      1. <i id='llimA'><tr id='llimA'><dt id='llimA'><q id='llimA'><span id='llimA'><b id='llimA'><form id='llimA'><ins id='llimA'></ins><ul id='llimA'></ul><sub id='llimA'></sub></form><legend id='llimA'></legend><bdo id='llimA'><pre id='llimA'><center id='llimA'></center></pre></bdo></b><th id='llimA'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='llimA'><tfoot id='llimA'></tfoot><dl id='llimA'><fieldset id='llimA'></fieldset></dl></div>

      2. <small id='llimA'></small><noframes id='llimA'>

          <tbody id='llimA'></tbody>

            <tfoot id='llimA'></tfoot>
              <legend id='llimA'><style id='llimA'><dir id='llimA'><q id='llimA'></q></dir></style></legend>
                  <bdo id='llimA'></bdo><ul id='llimA'></ul>
                  本文介紹了如何僅將列表中每個字符串的標題大寫?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  全部問題:編寫一個函數,將字符串列表作為參數,并返回一個列表,其中包含每個大寫為標題的字符串.也就是說,如果輸入參數是 ["apple pie", "brownies","chocolate","dulce de leche","eclairs"],你的函數應該返回 ["Apple餡餅"、布朗尼"、巧克力"、德萊切"、泡芙"].

                  WHOLE QUESTION: Write a function that takes as a parameter a list of strings and returns a list containing the each string capitalized as a title. That is, if the input parameter is ["apple pie", "brownies","chocolate","dulce de leche","eclairs"], your function should return ["Apple Pie", "Brownies","Chocolate","Dulce De Leche","Eclairs"].

                  我的程序(更新):

                  我想我的程序現在正在運行!問題是當我輸入: ["apple pie"] 它正在返回: ['"Apple Pie"']

                  I THINK I GOT MY PROGRAM RUNNING NOW! The problem is when I enter: ["apple pie"] it is returning: ['"Apple Pie"']

                  def Strings():
                    s = []
                    strings = input("Please enter a list of strings: ").title()
                    List = strings.replace('"','').replace('[','').replace(']','').split(",")
                    List = List + s
                  
                    return List
                  
                  def Capitalize(parameter):
                    r = []
                    for i in parameter:
                      r.append(i)
                  
                    return r
                  
                  def main():
                    y = Strings()
                    x = Capitalize(y)
                    print(x)
                  
                  main()
                  

                  我收到一個錯誤 AttributeError: 'list' object has no attribute 'title'請幫忙!

                  I am getting an error AttributeError: 'list' object has no attribute 'title' Please help!

                  推薦答案

                  只需遍歷名稱列表,然后對于每個名稱,僅通過指定首字母的索引號來更改首字母的大小寫.然后將返回的結果與剩余的字符相加,最后將新名稱附加到已經創建的空列表中.

                  Just iterate over the name list and then for each name, change the case of first letter only by specifying the index number of first letter. And then add the returned result with the remaining chars then finally append the new name to the already created empty list.

                  def Strings():
                  
                    strings = input("Please enter a list of strings: ")
                    List = strings.replace('"','').replace('[','').replace(']','').split(",")
                  
                  
                    return List
                  
                  def Capitalize(parameter):
                    r = []
                    for i in parameter:
                      m = ""
                      for j in i.split():
                        m += j[0].upper() + j[1:] + " "
                      r.append(m.rstrip())  
                  
                  
                    return r
                  
                  def main():
                    y = Strings()
                    x = Capitalize(y)
                    print(x)
                  
                  main()
                  

                  import re
                  strings = input("Please enter a list of strings: ")
                  List = [re.sub(r'^[A-Za-z]|(?<=s)[A-Za-z]', lambda m: m.group().upper(), name) for name in strings.replace('"','').replace('[','').replace(']','').split(",")]
                  print(List)
                  

                  這篇關于如何僅將列表中每個字符串的標題大寫?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to make a discord bot that gives roles in Python?(如何制作一個在 Python 中提供角色的不和諧機器人?)
                  Discord bot isn#39;t responding to commands(Discord 機器人沒有響應命令)
                  Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“關于我嗎?Discord 機器人的功能?(不和諧.py))
                  message.channel.id Discord PY(message.channel.id Discord PY)
                  How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 機器人?)
                  discord.py - Automaticaly Change an Role Color(discord.py - 自動更改角色顏色)
                  <legend id='NLQho'><style id='NLQho'><dir id='NLQho'><q id='NLQho'></q></dir></style></legend>

                  <small id='NLQho'></small><noframes id='NLQho'>

                      <tbody id='NLQho'></tbody>

                    <tfoot id='NLQho'></tfoot>

                      <bdo id='NLQho'></bdo><ul id='NLQho'></ul>

                          1. <i id='NLQho'><tr id='NLQho'><dt id='NLQho'><q id='NLQho'><span id='NLQho'><b id='NLQho'><form id='NLQho'><ins id='NLQho'></ins><ul id='NLQho'></ul><sub id='NLQho'></sub></form><legend id='NLQho'></legend><bdo id='NLQho'><pre id='NLQho'><center id='NLQho'></center></pre></bdo></b><th id='NLQho'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='NLQho'><tfoot id='NLQho'></tfoot><dl id='NLQho'><fieldset id='NLQho'></fieldset></dl></div>
                            主站蜘蛛池模板: 中文字幕日本一区二区 | 国产在线观看不卡一区二区三区 | 免费一级网站 | 亚洲综合电影 | 久久久亚洲一区 | 精品国产视频 | 成人在线视频免费看 | 一区二区免费在线视频 | 国产视频福利一区 | 亚洲久视频 | 亚洲在线观看视频 | 国产伦精品一区二区 | 免费黄色的视频 | 亚洲日日夜夜 | 日韩欧美三级电影在线观看 | 天天干天天爱天天 | 欧美三区在线观看 | 午夜精品一区 | 天天拍天天草 | 91精品国产91久久久久久 | 中文字幕一区在线观看视频 | 亚洲一区国产精品 | 欧美久久久久久久 | 成人免费网站在线 | 成人在线观看免费视频 | 国产一级片一区二区三区 | 久久精品国产一区二区三区不卡 | 亚洲色片网站 | 久久国产精品视频 | 久久国内 | 国产欧美日韩综合精品一 | 国内精品视频一区二区三区 | 亚洲日日操| 欧美一区 | 国产色网 | 超碰3| 国产午夜av片 | 成人在线观看免费视频 | 精品国产不卡一区二区三区 | 一区二区三区中文字幕 | 亚洲天堂日韩精品 |