+ 8

How to draw rectangle inside small rectangle with some value??

suppose user gives 5 as an input then inside small rectangle start 5 display 6 7 8 9 10 11 12 1 2 3 4 as its output. like in astrological birth chart.

22nd Aug 2018, 8:42 AM
Rameshwor Nepal
Rameshwor Nepal - avatar
1 Answer
0
recursion, try this def shift_left(lst, n): assert(n>0), "n wants non-neg int" def shift(ntimes): if ntimes == 0: return else: temp = lst[0] for index in range(len(lst) - 1): lst[index] = lst[index + 1] lst[index + 1] = temp return shift(ntimes-1) return shift(n)
24th Aug 2018, 4:20 AM
Crypto Thick
Crypto Thick - avatar