#Stringrev.py #Here we Use The Indexes in reversing a string and the code will be: def reverse ( a ): return (a[::- 1 ]) print (reverse( "Your String" )) # Here I used A function To Make It Easy
n = int ( input ( " Enter Here You Want to calculate the factorial: " )) x = 1 for i in range ( 1 , n + 1 ): x *= i print ( x ) """ FACTORIAL EXAMPLE: 1! = 1 2! = 2*1 = 2 3! = 3*2*1 = 6 4! = 4*3*2*1 = 24 5! = 5*4*3*2*1 = 120 """
Comments
Post a Comment