from sys import argvscript, first, second, third = argvprint "The script is called:", scriptprint "Your first variable is:", firstprint "Your second v...
分类:
其他好文 时间:
2014-10-23 14:07:22
阅读次数:
150
from sys import argvscript, filename = argvtxt = open(filename)print "Here's your file %r:" % filename print txt.read()print "Type the filename again:...
分类:
其他好文 时间:
2014-10-23 14:03:25
阅读次数:
129
from sys import argvscript, user_name = argvprompt = '> 'print "Hi %s, I'm the %s script." % (user_name, script)print "I'd like to ask you a few quest...
分类:
其他好文 时间:
2014-10-23 13:58:52
阅读次数:
170
age = raw_input("How old are you? ")height = raw_input("How tall are you? ")weight = raw_input("How much do you weigh? ")print "So, you're %r old, %r ...
分类:
其他好文 时间:
2014-10-23 12:21:22
阅读次数:
227
The process that a procedure generates is of course dependent on the rules used by the interpreter. As an example, consider the iterative gcd procedur...
分类:
编程语言 时间:
2014-10-22 20:02:02
阅读次数:
283
题目:There is a clever algorithm for computing the Fibonacci numbers in a logarithmic number of steps.Recall the transformation of the state variables a...
分类:
其他好文 时间:
2014-10-22 17:46:46
阅读次数:
108
x = "There are %d types of people." % 10binary = "binary"do_not = "don't"y = "Those who know %s and those who %s." % (binary, do_not)print xprint ypri...
分类:
其他好文 时间:
2014-10-22 14:22:51
阅读次数:
122
my_name = 'Zed A. Shaw'my_age = 35 # not a liemy_height = 74 # inchesmy_weight = 180 # lbsmy_eyes = 'Blue'my_teeth = 'White'my_hair = 'Brown'print "Le...
分类:
其他好文 时间:
2014-10-21 23:05:05
阅读次数:
257
package com.exercise.coreJava;/** *求2/1+3/2+5/3+8/5+13/8...前20项之和 */public class Sum { public static void main(String[] args) { double sum ...
分类:
其他好文 时间:
2014-10-21 12:08:49
阅读次数:
153
# A comment, this is so you can read your program later.# Anything after the # is ignored by python.print "I could have code like this." # and the com...
分类:
其他好文 时间:
2014-10-21 10:14:12
阅读次数:
137