Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

LoveMathFermat

Hi fellow OCW student, I have a question about ps3b.py homework; writing hangman code computer part. from ps3a import * import time from perm import * what is importing other codes mean? are all the functions from the imported codes allowed to use ?

  • one year ago
  • one year ago

  • This Question is Open
  1. LoveMathFermat
    Best Response
    You've already chosen the best response.
    Medals 0

    *correction-a word game, not hangman.

    • one year ago
  2. bwCA
    Best Response
    You've already chosen the best response.
    Medals 1

    yep, the objects from those modules will be available in the local namespace.

    • one year ago
  3. rsmith6559
    Best Response
    You've already chosen the best response.
    Medals 0

    The import statement imports ( brings in to ) other modules and libraries into your program. The two types of import statement that you have import things differently. import time imports the time module into your program, but in it's own namespace. To get the localtime, you have to call time's functions with time as the namespace: time.localtime( time.time() ) from perm import * imports all ( * ) of perm's functions into the local namespace. To use one of perm's functions or objects, you don't have to preface it with perm. Some other languages like C #include instead of import their libraries. Usage wise, it's basically the same.

    • one year ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.