原创 小白學Python ——day6

老師授課內容: day06-實訓6 1、函數高級     遞歸函數         什麼叫做遞歸函數?自己調用自己的函數叫做遞歸函數,所以遞歸函數其實就是一種循環。         寫遞歸函數一定要有退出條件,否則程序崩潰        

原创 小白學Python ——day5

老師授課內容: day05-實訓5 1、常用函數 字符串函數(非常重要)  ord() 給一個字符,轉化爲ascii值  chr() 給一個ascii值,轉化爲字符  join() 將列表裏面的字符串按照特定的字符拼接  ljust(wi

原创 十進制轉換------Python

# 二進制: def binary(number):     number_str = ''     shang = number     while 1:         number_str += str(shang % 2)    

原创 刪除列表中指定的所有重複元素

eg:輸入: [1, 2, 3, 4, 3, 5, 3]   刪除:3 結果:  [1, 2, 4, 5] def shan(lt, item):     count = lt.count(item)     if count == 0:

原创 小白學Python ——day4

老師授課內容 day04-實訓4 1、雙重循環     循環也可以嵌套,如果循環裏面還有循環,稱之爲雙重循環 2、函數     定義:在項目的開發過程中,有一些代碼會被反覆的使用到。程序猿就會將這個代碼塊封裝起來,那麼封裝起來的代碼塊就叫

原创 字母圖形-----python

問題: 給一個字符,打印出下面的圖形 輸入'F' 輸出: # F # EF # DEF # CDEF # BCDEF # ABCDEF 解析: ''' i = 2 j的變化是:0~1 0 :E  1 : F F-1    F-0 i =

原创 等腰三角形----python

問題:打印一個等腰三角形 解析:   *   ***  ***** ******* 1  j<4-0  打印空格,其它打印* 2  j<4-1  打印空格,其它打印* 3  j<4-2  打印空格,其它打印* 1 n 2 n+1 3 n+

原创 小白學Python ——day3

實訓第三天內容: day03-實訓3 0、ascii值和字符之間的轉化     ord() : 將字符轉化爲整型     chr() : 將整型轉化爲字符 1、while循環     什麼是循環?一直在重複的做某件事情     到代碼中

原创 小白學Python ——day1

今天是我們實習的第一天,來到鄭州千峯的培訓基地。在選擇實習方向上,我們寢室選擇聽從學霸室友的建議,學習Python。因爲這在研究生的學習中應用很廣泛。 第一天學習很簡單,就是了解Python,知道Python現在的用處,Python的安裝

原创 小白學Python ——day2

今天老師主要講的內容如下: day02-實訓2 1、數據類型     字符串長度         求解字符串長度,無論是英文還是中文,求解的是裏面字符的個數         ascii表格,就是常用字符和二進制之間的對應關係       

原创 Find Q

Problem Description Byteasar is addicted to the English letter 'q'. Now he comes across a string S consisting of low

原创 1078 - Integer Divisibility

Description If an integer is not divisible by 2 or 5, some multiple of that number in decimal notation is a sequence

原创 lightoj 1214 - Large Division 大數對小數取餘

Description Given two integers, a and b, you should check whether a is divisible by b or not. We know that an integer

原创 Aggressive cows

Description Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a s

原创 Positive Negative Sign

Description Given two integers: n and m and n is divisible by 2m, you have to write down the first n natural numbers