Python 3 Tutorial - Write A Python Program To Reverse A String Without Using Built-In Functions

Опубликовано: 16 Февраль 2024
на канале: Code With TJ
583
1

Hello Programmers, Welcome to my channel.

In this video you will learn about how to Write A Python Program To Reverse A String Without Using Built-In Functions


Python Scripts
========================
https://codewithtj.blogspot.com/2024/...

Python Functions Solved
========================
https://codewithtj.blogspot.com/2023/...

Python Programs Solved
========================
https://codewithtj.blogspot.com/2023/...


Code
=============================
ip_string = input("Enter a String : ")
op_string = ""

for letter in ip_string:
op_string = letter + op_string

print(f"Reverse of String is : {op_string}")


Code 2 using iter() function
===================================
ip_string = input("Enter a String : ")
my_iterator = iter(ip_string)
op_string = ""

try:
while True:
item = next(my_iterator)
op_string = item + op_string
except StopIteration:
pass
finally:
print(op_string)


Keywords
=============================
#python #python3 #python_assignment #pythonprogramming #pythontutorial #pythonprojects #pythoncourse #pythonbaba #pythonforbeginners #pythonautomation #pythonbasic #pythonbeginners