Reverse the string (String)
Write a function that receives a string (String) as input and reversed it
Example
Write a function that receives a string (String) as input and reversed it
Example
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
user=input("Enter ant word you want: ) print(user.reversed())
It's a brief and good code just a little double -dot in the Inport.
def reverse(str): reverse_str = str[::-1] return reverse_str string = input("enter your text: ") print(reverse(string))
def reverse(text): return reversed(text) char = (input('number : ')) print(*reverse(char))
class Words: def __init__(self, word): self.word = word def print_word(self): return self.word[::-1] word = input("enter your word: ") obj = Words(word) print("کلمه برعکس:", obj.print_word())
def reverse(string): return string[::-1] # Examples print(reverse('amir')) # rima print(reverse('hello')) # olleh
string = input("please enter a string: ") print(string[: : -1])
i = input("Enter: ")
print(i[slice(None,None,-1)])
Or ...i = input("Enter: ")
print(i[::-1])
Submitting answers is currently unavailable.
Write a program that receives 2 numbers as the interval, in which the interval of all the 5 existing numbers. For example, in the interval of 1 to 20 the number 2 times the number 5 repeated (5 and 15)
Write a program that receives 2 dates in yyyy/mm/dd format and print 2 dates to the output for example Tarikh1: 1401/11/01 tarikh2: 1401/11/05 4 days Tarikh1: 1401/10/01 Tarikh2: 1401/11/05 34 Days
Write a program that receives the radius of the circle and prints its area and environmental area = radius * Pi (3.14) circle environment = diameter (radius * 2) * Pi (3.14)
Write a program that receives the square area from the user and prints the size of each side in the output
Write a program that receives a number from the user and converts to letters suppose the numbers entered between 0 and 1000000 23 ➞ Twenty Three 405 ➞ Four HundredR
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام If you don’t understand the exercise or can’t solve it for any reason, that’s completely
normal—don’t worry 😊
Try checking out easier exercises and reviewing different answers
submitted by others. Gradually, you can move on to more challenging exercises. Also, your answer
might be correct even if it’s different from others.