第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何編輯規(guī)范化函數(shù),以便它也刪除標(biāo)點符號和行尾字符

如何編輯規(guī)范化函數(shù),以便它也刪除標(biāo)點符號和行尾字符

鳳凰求蠱 2023-10-25 11:00:38
import sqlite3con = sqlite3.connect(":memory:")columns = ["Nom", "Age", "Taille"]columns_str = '"' + '","'.join(columns) + '"'con.execute(f"CREATE TABLE people ({columns_str})")data = [  ('Karl', 11, 185)]stmt = f"INSERT INTO people ({columns_str}) VALUES (?, ?, ?)"con.executemany(stmt, data)另外,可能不要打電話給你的桌子master——稍后會變得非?;靵y。L像和 之類的名字list2也沒有幫助。明確命名變量,按照它們的含義或包含的內(nèi)容命名。未來的你會感謝你的。也許更干凈一點:import sqlite3con = sqlite3.connect(":memory:")columns = ("Nom", "Age", "Taille")con.execute("CREATE TABLE people (%s, %s, %s)" % columns)data = [  ('Karl', 11, 185)]stmt = f"INSERT INTO people (%s, %s, %s) VALUES (?, ?, ?)" % columnscon.executemany(stmt, data)
查看完整描述

1 回答

?
米琪卡哇伊

TA貢獻(xiàn)1998條經(jīng)驗 獲得超6個贊

這是一種方法:


import re


...


def normalize(data):

    #converting all letters to lowercase

    lowercase_lines=[x.lower() for x in data]

    # strip out all non-word or tab or space characters

    stripped_lines = [re.sub(r"[^\w \t]+", "", x) for x in lowercase_lines]

    print(stripped_lines)

    return stripped_lines


查看完整回答
反對 回復(fù) 2023-10-25
  • 1 回答
  • 0 關(guān)注
  • 166 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號