Created
July 27, 2022 18:04
Revisions
-
serafdev created this gist
Jul 27, 2022 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ from typing import List import random def f(x: List[int] = []) -> List[int]: """ Function that appends 1 random int to List x. If no list is passed, returns a List with 1 element. """ x.append(random.randint(0, 100)) return x print(f()) print(f()) print(f()) print(f()) """ Returns: [84] [84, 70] [84, 70, 1] [84, 70, 1, 16] """