Practice One

Practice One

Question 1: How much three-digit number can we get from number 1,2,3,4 ? Here the three-digit number has no duplicate numbers and is not the same as each other.

Question 2 : How much three-digit number can we get from number 0,1,2,3 ? Here the three-digit number has no duplicate numbers and is not the same as each other.

Question 1: How much three-digit number can we get from number 1,2,3,4 ? Here the three-digit number has no duplicate numbers and is not the same as each other.
1
2
3
4
5
6
7
8
9
n = 0
for i in range(1,5):
for j in range(1,5):
for k in range(1,5):
if i != j and j != k and i != k:
a = 100*i + 10*j +k
print(a)
n += 1
print(n)
Question 2 : How much three-digit number can we get from number 0,1,2,3 ? Here the three-digit number has no duplicate numbers and is not the same as each other.

Hint : hundreds place must not be zero.

1
2
3
4
5
6
7
8
9
10
n = 0
for i in range(0,4):
for j in range(0,4):
for k in range(0,4):
if i !=0:
if i != j and j != k and i != k:
a = 100*i + 10*j +k
print(a)
n += 1
print(n)

本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!