0
Using a nested for loop in python
Print: 86420 02468 86420 02468 My code: num = '86420' reverse = ' ' for x in range (len(num), 0, -1): for y in range (len(num), 0, -1): reverse +=num[a-1] print(reverse) print()
4 ответов
+ 3
num = '86420'
for x in range ( len( num ) ):
print( num )
num = num[ : : -1 ]
+ 1
using list comprehension
[print("86420"[::-1] if i%2 else "86420") for i in range(4)]
0
num='Abhishek kumar'
reverese=num[::-1]
print(reverese)
a=len(num)
b=''
for x in range(a-1,-1,-1):
b=b+num[x]
print(b)