+ 1

How can we print number 1 to N without the use of looping and recussion in python 3

no use of looping and recussion and no silly answers. plz

4th Nov 2017, 8:16 PM
Prashant Mishra
Prashant Mishra - avatar
2 ответов
+ 5
Write 2 functions that call eachother, passing the number + 1 as arguments until n is reached. Basically a hand up version of recursion without recursion.
4th Nov 2017, 9:03 PM
Rrestoring faith
Rrestoring faith - avatar
+ 1
#To print N numbers without loop.. #Not exactly.. but near one.. MyList = list(range(n+1)) print (MyList)
12th Nov 2017, 6:08 PM
Ramanagoud Padnur
Ramanagoud Padnur - avatar