-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 0f422ea
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from sys import argv | ||
|
||
# 12345678 => [12, 34, 56, 78] | ||
|
||
arg = int(argv[1]) | ||
print(arg) | ||
|
||
def fourth_list(num): | ||
mylist = [0,0,0,0] | ||
if num < 100: | ||
mylist[3] = num | ||
elif num < 100**2: | ||
mylist[2] = num // 100 | ||
mylist[3] = num % 100 | ||
elif num < 100**3: | ||
mylist[1] = num // 100**2 | ||
mylist[2] = num % 100**2 // 100 | ||
mylist[3] = num % 100**2 % 100 | ||
else: | ||
mylist[0] = num // 100**3 | ||
mylist[1] = num % 100**3 // 100**2 | ||
mylist[2] = num % 100**3 % 100**2 // 100 | ||
mylist[3] = num % 100**3 % 100**2 % 100 | ||
return mylist | ||
|
||
if arg < 100**4: | ||
print(fourth_list(arg)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
my python test scripts |