[Python] pass 的妙用
- 2022.02.09
- Python
雖然可能是廢話,pass的作用就是沒有作用, 用來填補尚未寫入任何內容的 function 或 loop
雖然可能是廢話,pass的作用就是沒有作用, 用來填補尚未寫入任何內容的 function 或 loop
str.join(iterable)或{分隔符}.join({可迭代對象}) 範例 " ".join(["Happy", "Birthday", "to", "You"])⇒"Happy Birthday to You" ".".join(["192", "168", "0", "1"])⇒"192.168.0.1" 用 for 宣告 str 物件 "".join(itertools.chain( ...
isinstance(object, classinfo) 注意是 classinfo 不是 string 範例 isinstance("123", str) – True isinstance("123", int) – False Ref https://docs.python.org/3/library/functions.html#isinstance
Question Given an array of integers arr, you’re asked to calculate for each index i the product of all integers except the integer at that index (i.e. except arr[i]). Implement a function arrayOfArray ...
Question In a Binary Search Tree (BST), an Inorder Successor of a node is defined as the node with the smallest key greater than the key of the input node (see examples below). Given a node inputNode ...
Question Given an array of unique characters arr and a string str, Implement a function getShortestUniqueSubstring that finds the smallest substring of str containing all the characters in arr. Return ...
Question You’re testing a new driverless car that is located at the Southwest (bottom-left) corner of an n×n grid. The car is supposed to get to the opposite, Northeast (top-right), corner of the grid ...
交換兩個變數 a, b = b, a 先運算完等號右邊才賦值給等號左邊
Question Given an array arr of unique nonnegative integers, implement a function getDifferentNumber that finds the smallest nonnegative integer that is NOT in the array. Even if your programming langu ...
一週心得 「子音 + 母音」應該一氣呵成的發,並且子音的持續時間只有極短一瞬間 Ex: 固 ─ 「固ㄨ~」、為 ─ 「ㄨㄟ~」 換氣時用鼻子換氣(為擴張開鼻腔及咽腔後方空間),換氣時間很短時口鼻並用 發聲練習 橫膈膜訓練 將身體分做:胸部、上腹部(至肚臍為止)、下腹部 用鼻子吸飽氣,以擴張開鼻腔及咽腔後方空間 肚子吸飽氣,要感覺到腹部兩側及背部也鼓起至隆起 用雙手手掌前端強力插入上腹部,腹部不出力 ...