Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Insert a sequence of same numbers, unpacking
#python 3.5.2 def get_nums(n, freq): l = [n] * freq return l # TEST CASE 1 ELEV = [1.2, 3.2, *get_nums(0.0, 2) ,3.9, *get_nums(0.0, 3)] print(ELEV) print() # newline # TEST CASE 2 arr = [45, *get_nums(1, 4), *get_nums(9, 3), 34, 99, *get_nums(7, 1), 12, 21, *get_nums(-1, 5)] print(arr)
run
|
edit
|
history
|
help
0
Python_Hello_World
nnnn
HW Descending order
teretere
PyTeleBook
Variables mutables e inmutables
1
DuckTyping.py
intervalos
Phython