Translator in Python

Translator in Python

Hello friends, In this Blog Post we can study“Translator in Python”.

we can choose starting and destination languages as per our requirements.

for this purpose, we need to install google trans module

pip install googletrans

Source Code:

from googletrans import Translator
print("What is the staring language?")
start_lang=input()
print("What is the final language?")
final_lang=input()
print("What is the sentance?")
sent=input()

translator=Translator()
trans_sent=translator.translate(sent, src=start_lang, dest=final_lang)
print(trans_sent.text)

Output:

Translator in Python

Harsh

Hey Friends, Welcome to thetechbuddy. This blog is about technical or programming knowledge.

Leave a Reply