Reversing the words of the sentence
Write a program that receives a sentence and reverses each word and re -print the sentence without changing the order of words.
Input: Hello Amir ...
Olleh RIMA ...
Write a program that receives a sentence and reverses each word and re -print the sentence without changing the order of words.
Input: Hello Amir ...
Olleh RIMA ...
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
r = input("matn: ") h = "" for i in r: # Reverse the string h = i + h print(h)
a=[] b=(input('str:')) for i in b: a.append(i) for j in reversed(a): print(j,end="")
def reverse_words_in_sentence(sentence): words = sentence.split() reversed_words = [word[::-1] for word in words] return ' '.join(reversed_words) sentence = input("Enter a sentence: ") print(reverse_words_in_sentence(sentence))
def reverse_words(sentence): """این تابع کلمات یک جمله را برعکس میکند.""" # Divide the sentence into words words = sentence.split() # Reversing any word reversed_words = [word[::-1] for word in words] # Converting the list of inverse words into a sentence reversed_sentence = ' '.join(reversed_words) return reversed_sentence def main(): # Receive a sentence from the user sentence = input("لطفاً یک جمله وارد کنید: ") # Reversing the words and printing the result result = reverse_words(sentence) print(result) # Implementation of the program main()
en_string = input ('str: ') rev = [i[::-1] for i in en_string.split()] rev_u = " ".join(rev) print (f'{rev_u} --> {en_string}')
def reverse_words(sentence): # Separate sentence words words = sentence.split() # Reversing any word and saving in the new list reversed_words = [word[::-1] for word in words] # Combining the inverse words into a sentence reversed_sentence = " ".join(reversed_words) return reversed_sentence
def str(name): s=name.split() r=map(lambda t:t[::-1],s) return ''.join(r) text=input("text: ") print(str(text))
Submitting answers is currently unavailable.
Write a program that receives a number of input and the factoriel calculates and prints it
Using JavaScript, send a request with the following specifications method = posturl = /test.php FNAME information =? Lname =? Age =? Get the information above through Prompt from the user
Write a function that receives a number and specifies or not to be paired by returning TRUE or FALSE
Write a function that receives a numeric and if that number was the first number True and otherwise False returned
Write a program that receives two users and prints the mean on output
Write a program that receives an infinite number from the user and when the user entered the number 0; Print all numbers entered from large to small in the output
Create a link with the following details by clicking the user link to be directly calling 090000000.
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام 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.