Python Forum
urgent , Python homework
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
urgent , Python homework
#1
Exclamation 
This is what I am supposed to do :



(Anagrams) An anagram of a string is another string formed by rearranging the letters in the first.
Write a script that produces all possible anagrams of a given string using only techniques that
you’ve seen to this point. (Translation Dictionary)
Use an online translation tool such as Bing Microsoft Translator or Google Translate to translate
English words to another language. Create a translations dictionary that maps the English words
to their translations.
5
Display a twocolumn table of translations.
(Synonyms Dictionary)
Use an online thesaurus to look up synonyms for five words, then create a synonyms dictionary
that maps those words to lists containing three synonyms for each word.
Display the dictionary’s contents as a key with an indented list of synonyms below it.

This is what I have done so far :
#Anagrams
import random
import dictionnary 
a = input("Please enter apers ")
x = ["a","p","e","r","s"]
try:
    while(a=="apers" or a=="Apers"):
        print(random.choice(x)+random.choice(x)+random.choice(x)+random.choice(x)+random.choice(x))
        a = input("Please enter apers ")
        
        
     
except:
    a = input("Please enter apers ")
Thank u in advance Big Grin Heart
Larz60+ write May-08-2021, 04:23 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use bbcode tags on future posts.
Reply
#2
(May-08-2021, 03:53 PM)alm Wrote: This is what I am supposed to do :



(Anagrams) An anagram of a string is another string formed by rearranging the letters in the first.
Write a script that produces all possible anagrams of a given string using only techniques that
you’ve seen to this point. (Translation Dictionary)
Use an online translation tool such as Bing Microsoft Translator or Google Translate to translate
English words to another language. Create a translations dictionary that maps the English words
to their translations.
5
Display a twocolumn table of translations.
(Synonyms Dictionary)
Use an online thesaurus to look up synonyms for five words, then create a synonyms dictionary
that maps those words to lists containing three synonyms for each word.
Display the dictionary’s contents as a key with an indented list of synonyms below it.


This is what I have done so far :
#Anagrams
import random
import dictionnary 
a = input("Please enter apers ")
x = ["a","p","e","r","s"]
try:
    while(a=="apers" or a=="Apers"):
        print(random.choice(x)+random.choice(x)+random.choice(x)+random.choice(x)+random.choice(x))
        a = input("Please enter apers ")
        
        
     
except:
    a = input("Please enter apers ")
Thank u in advance Big Grin Heart
code result for now :
Error:
= RESTART: C:/Users/naza/AppData/Local/Programs/Python/Python39/Homework lab.py Traceback (most recent call last): File "C:/Users/naza/AppData/Local/Programs/Python/Python39/Homework lab.py", line 3, in <module> import dictionnary ModuleNotFoundError: No module named 'dictionnary'

ok
buran write May-08-2021, 05:57 PM:
Please, use proper tags when post code, traceback, output, etc. This time I have added error tags for you.
See BBcode help for more info.

Also, no need to quote full post
Reply
#3
The error you have ModuleNotFoundError: No module named 'dictionnary' is because you are trying to import dictionnary but there is no dictionnary module to import, have you not created it yet or do you maybe have a typo in its name?
alm likes this post
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  HELP in python homework makashito 4 3,932 Oct-12-2021, 10:12 AM
Last Post: buran
Exclamation Python Homework (Urgent help needed!!) chickenseizuresalad 6 4,295 Oct-11-2021, 01:59 AM
Last Post: Underscore
  CyperSecurity Using Python HomeWork ward1995 1 1,966 Jul-08-2021, 03:55 PM
Last Post: buran
  urgent I got a syntax errors alm 2 5,877 Feb-28-2021, 02:54 PM
Last Post: alm
Heart Urgent homework help needed Medou 4 2,731 Nov-24-2020, 09:28 AM
Last Post: buran
  Homework with python Johnsonmfw 1 1,694 Sep-20-2020, 04:03 AM
Last Post: ndc85430
  [Urgent] build code GodMaster 2 1,809 Mar-23-2020, 12:25 AM
Last Post: jefsummers
  Bifid Genkey (Urgent) Laura123 2 2,054 Mar-09-2020, 08:09 PM
Last Post: micseydel
  Python Homework Help *Urgent GS31 2 2,587 Nov-24-2019, 01:41 PM
Last Post: ichabod801
  Python Homework Question OrcDroid123 1 2,378 Sep-01-2019, 08:44 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020