Python 練習(xí)實(shí)例46 Python 100例 題目:求輸入數(shù)字的平方,如果平方運(yùn)算后小于 50 則退出。 程序分析:無 程序源代碼: #!/usr/bin/python # -*- coding: UTF-8 -*- TRUE = 1 FALSE = 0 def SQ(x): return x * x print '如果輸入的數(shù)字小于 50,程序?qū)⑼V?..
http://m.o2fo.com/python/python-exercise-example46.htmlPython 練習(xí)實(shí)例56 Python 100例 題目:畫圖,學(xué)用circle畫圓形?! ?程序分析:無。 程序源代碼: #!/usr/bin/python # -*- coding: UTF-8 -*- if __name__ == '__main__': from Tkinter import * canvas = Canvas(width=800, height=600, bg='yellow') canvas.pa...
http://m.o2fo.com/python/python-exercise-example56.htmlPython 練習(xí)實(shí)例66 Python 100例 題目:輸入3個(gè)數(shù)a,b,c,按大小順序輸出?! ?程序分析:無。 程序源代碼: #!/usr/bin/python # -*- coding: UTF-8 -*- if __name__ == '__main__': n1 = int(raw_input('n1 = :\n')) n2 = int(raw_input('n2 = :\n')) n...
http://m.o2fo.com/python/python-exercise-example66.htmlPython 練習(xí)實(shí)例47 Python 100例 題目:兩個(gè)變量值互換。 程序分析:無 程序源代碼: #!/usr/bin/python # -*- coding: UTF-8 -*- def exchange(a,b): a,b = b,a return (a,b) if __name__ == '__main__': x = 10 y = 20 print 'x = %d,y = %d' % (x,y) x,y = exchange(x,y) ...
http://m.o2fo.com/python/python-exercise-example47.htmlPython 練習(xí)實(shí)例57 Python 100例 題目:畫圖,學(xué)用line畫直線。 程序分析:無。 程序源代碼: #!/usr/bin/python # -*- coding: UTF-8 -*- if __name__ == '__main__': from Tkinter import * canvas = Canvas(width=300, height=300, bg='green') canvas.pack(expand=Y...
http://m.o2fo.com/python/python-exercise-example57.htmlPython 練習(xí)實(shí)例67 Python 100例 題目:輸入數(shù)組,最大的與第一個(gè)元素交換,最小的與最后一個(gè)元素交換,輸出數(shù)組。 程序分析:無。 程序源代碼: #!/usr/bin/python # -*- coding: UTF-8 -*- def inp(numbers): for i in range(9): numbers.append(int(raw_input...
http://m.o2fo.com/python/python-exercise-example67.htmlPython 練習(xí)實(shí)例68 Python 100例 題目:有n個(gè)整數(shù),使其前面各數(shù)順序向后移m個(gè)位置,最后m個(gè)數(shù)變成最前面的m個(gè)數(shù) 程序分析:無。 程序源代碼: #!/usr/bin/python # -*- coding: UTF-8 -*- if __name__ == '__main__': n = int(raw_input('the total nu...
http://m.o2fo.com/python/python-exercise-example68.htmlPython 練習(xí)實(shí)例78 Python 100例 題目:找到年齡最大的人,并輸出。請(qǐng)找出程序中有什么問題。 程序分析:無。 程序源代碼: #!/usr/bin/python # -*- coding: UTF-8 -*- if __name__ == '__main__': person = {"li":18,"wang":50,"zhang":20,"sun":22} m = 'li...
http://m.o2fo.com/python/python-exercise-example78.htmlPython 練習(xí)實(shí)例79 Python 100例 題目:字符串排序。 程序分析:無。 程序源代碼: #!/usr/bin/python # -*- coding: UTF-8 -*- if __name__ == '__main__': str1 = raw_input('input string:\n') str2 = raw_input('input string:\n') str3 = raw_input('input s...
http://m.o2fo.com/python/python-exercise-example79.htmlPython 練習(xí)實(shí)例70 Python 100例 題目:寫一個(gè)函數(shù),求一個(gè)字符串的長(zhǎng)度,在main函數(shù)中輸入字符串,并輸出其長(zhǎng)度。 程序分析:無。 程序源代碼: #!/usr/bin/python # -*- coding: UTF-8 -*- if __name__ == '__main__': s = raw_input('please input ...
http://m.o2fo.com/python/python-exercise-example70.html抱歉,暫時(shí)沒有相關(guān)的微課
w3cschool 建議您:
抱歉,暫時(shí)沒有相關(guān)的視頻課程
w3cschool 建議您:
抱歉,暫時(shí)沒有相關(guān)的教程
w3cschool 建議您:
Python 練習(xí)實(shí)例46 Python 100例 題目:求輸入數(shù)字的平方,如果平方運(yùn)算后小于 50 則退出。 程序分析:無 程序源代碼: #!/usr/bin/python # -*- coding: UTF-8 -*- TRUE = 1 FALSE = 0 def SQ(x): return x * x print '如果輸入的數(shù)字小于 50,程序?qū)⑼V?..
http://m.o2fo.com/python/python-exercise-example46.htmlPython 練習(xí)實(shí)例56 Python 100例 題目:畫圖,學(xué)用circle畫圓形?! ?程序分析:無。 程序源代碼: #!/usr/bin/python # -*- coding: UTF-8 -*- if __name__ == '__main__': from Tkinter import * canvas = Canvas(width=800, height=600, bg='yellow') canvas.pa...
http://m.o2fo.com/python/python-exercise-example56.htmlPython 練習(xí)實(shí)例66 Python 100例 題目:輸入3個(gè)數(shù)a,b,c,按大小順序輸出?! ?程序分析:無。 程序源代碼: #!/usr/bin/python # -*- coding: UTF-8 -*- if __name__ == '__main__': n1 = int(raw_input('n1 = :\n')) n2 = int(raw_input('n2 = :\n')) n...
http://m.o2fo.com/python/python-exercise-example66.htmlPython 練習(xí)實(shí)例47 Python 100例 題目:兩個(gè)變量值互換。 程序分析:無 程序源代碼: #!/usr/bin/python # -*- coding: UTF-8 -*- def exchange(a,b): a,b = b,a return (a,b) if __name__ == '__main__': x = 10 y = 20 print 'x = %d,y = %d' % (x,y) x,y = exchange(x,y) ...
http://m.o2fo.com/python/python-exercise-example47.htmlPython 練習(xí)實(shí)例57 Python 100例 題目:畫圖,學(xué)用line畫直線。 程序分析:無。 程序源代碼: #!/usr/bin/python # -*- coding: UTF-8 -*- if __name__ == '__main__': from Tkinter import * canvas = Canvas(width=300, height=300, bg='green') canvas.pack(expand=Y...
http://m.o2fo.com/python/python-exercise-example57.htmlPython 練習(xí)實(shí)例67 Python 100例 題目:輸入數(shù)組,最大的與第一個(gè)元素交換,最小的與最后一個(gè)元素交換,輸出數(shù)組。 程序分析:無。 程序源代碼: #!/usr/bin/python # -*- coding: UTF-8 -*- def inp(numbers): for i in range(9): numbers.append(int(raw_input...
http://m.o2fo.com/python/python-exercise-example67.htmlPython 練習(xí)實(shí)例68 Python 100例 題目:有n個(gè)整數(shù),使其前面各數(shù)順序向后移m個(gè)位置,最后m個(gè)數(shù)變成最前面的m個(gè)數(shù) 程序分析:無。 程序源代碼: #!/usr/bin/python # -*- coding: UTF-8 -*- if __name__ == '__main__': n = int(raw_input('the total nu...
http://m.o2fo.com/python/python-exercise-example68.htmlPython 練習(xí)實(shí)例78 Python 100例 題目:找到年齡最大的人,并輸出。請(qǐng)找出程序中有什么問題。 程序分析:無。 程序源代碼: #!/usr/bin/python # -*- coding: UTF-8 -*- if __name__ == '__main__': person = {"li":18,"wang":50,"zhang":20,"sun":22} m = 'li...
http://m.o2fo.com/python/python-exercise-example78.htmlPython 練習(xí)實(shí)例79 Python 100例 題目:字符串排序。 程序分析:無。 程序源代碼: #!/usr/bin/python # -*- coding: UTF-8 -*- if __name__ == '__main__': str1 = raw_input('input string:\n') str2 = raw_input('input string:\n') str3 = raw_input('input s...
http://m.o2fo.com/python/python-exercise-example79.htmlPython 練習(xí)實(shí)例70 Python 100例 題目:寫一個(gè)函數(shù),求一個(gè)字符串的長(zhǎng)度,在main函數(shù)中輸入字符串,并輸出其長(zhǎng)度。 程序分析:無。 程序源代碼: #!/usr/bin/python # -*- coding: UTF-8 -*- if __name__ == '__main__': s = raw_input('please input ...
http://m.o2fo.com/python/python-exercise-example70.html抱歉,暫時(shí)沒有相關(guān)的文章
w3cschool 建議您: