Search This Blog

Thursday, 18 November 2021

program to pass a string to a function. Return and print reverse of it

 Write a program to pass a string to a function.return and print reverse of it

def reverse(n):
n1=""
for i in n:
n1=i+n1
print("Reverse ",n1)
def main():
n=input("Enter any string ")
reverse(n)
"""
if __name__=='__main__':
main()
"""
#or
#function calling
main()




Output:-
(1). Enter any string apple
Reverse elppa
(2). Enter any string bat
Reverse tab
(3). Enter any string computer
Reverse retupmoc

No comments:

Post a Comment

how to implement YOLOv3 using Python and TensorFlow

Object Detection with YOLOv3 Introduction YOLOv3 (You Only Look Once version 3) is a real-time object detection algorithm that can detect ob...