i = 1
j = 2
while i < 10:
j = 2
while j < 10:
if i < j:
print i * 10 + j
j += 1
i += 1
j = 2
while i < 10:
j = 2
while j < 10:
if i < j:
print i * 10 + j
j += 1
i += 1
2015-09-21
def firstCharUpper(s):
s1=s[0:1]
s2=s1.upper()
s3=s[1:]
return s2+s3
print firstCharUpper('hello')
print firstCharUpper('sunday')
print firstCharUpper('september')
s1=s[0:1]
s2=s1.upper()
s3=s[1:]
return s2+s3
print firstCharUpper('hello')
print firstCharUpper('sunday')
print firstCharUpper('september')
2015-09-21
sum = 0
x = 1
n = 1
while True:
sum =sum+2**(n-x)
n=n+1
if n==21:
break
print sum
x = 1
n = 1
while True:
sum =sum+2**(n-x)
n=n+1
if n==21:
break
print sum
2015-09-18
def calc(count,Total):
if count < 100:
count+=1
if count%2 == 1:
Total += count
calc(count,Total)
else:
print(Total)
calc(0,0)
if count < 100:
count+=1
if count%2 == 1:
Total += count
calc(count,Total)
else:
print(Total)
calc(0,0)
2015-09-18
L = [75, 92, 59, 68]
sum = 0.0
for Val in L:
sum += Val
print sum / 4
sum = 0.0
for Val in L:
sum += Val
print sum / 4
2015-09-18
t = ('a', 'b', "['A', 'B']")
直接将list转为字符串
直接将list转为字符串
2015-09-18