Professional Documents
Culture Documents
Technical Communication Assignment-1 2023 (VK)
Technical Communication Assignment-1 2023 (VK)
Output:-
b) while loop
str = "JavaTpoint"
print ("The original string is : ",str)
reverse_String = ""
count = len(str)
while count > 0:
reverse_String += str[ count - 1 ]
count = count - 1
print ("The reversed string using a while loop is :
",reverse_String)
Output:-
c) Slice Operator
def reverse(str):
str = str[::-1]
return str
s = "JavaTpoint"
print ("The original string is : ",s)
print ("The reversed string using extended slice operator
is : ",reverse(s))
Output:-
Program no. 2: WAP to print Character at odd position and Even position.
Output:-
Program no. 3: WAP to merge character of string into a single string by taking
character alternatively.