forum

Need help with python coding/understanding

posted
Total Posts
4
Topic Starter
Gabi
Hi

i just started coding in python (literally today) and i missed the first lecture where we had a coding session because i was sick. so basicly i am stuck with some assignments that i have no clue what to do with. what i need is kind of a code example that shows me how to code these stuff. ok im gonna paste in some of the assignments here. im not completley sure about the translations but yea hopefully if there are any python coders here i think they will understand :3

-----

Create the following amounts(masses?): A = (1, 2, 3, 4), B = (3, 4, 5), C = (5), and let U = (0, 1, 2, 3, 4, 5, 6 , 7). test if the following expression is true using pen and paper, and then in Python.




ok i can understand amost alll of these. like "1. is true" and "4. is true" however i have no clue on how they are supposed to be coded into python, or how it should look like. hell i don't even know if this is enough information :<. but yea if anyone understands anything, please give an example of 1 or 2 codes on how it should look like.

Thanks
Gabi~

P.S: the swedish text on 3. says "try these aswell (using "frozenset") <-- would be nice with an example aswell :>
Intermezzo
As these are no real coding assignments, I assume the course uses the python interpreter as a Matlab substitute.
I think your course probably relies on python imports like these: NumPy and SciPy
If so you probably would be interested in : http://www.oreillynet.com/pub/a/python/ ... cally.html
and IPython: http://ipython.scipy.org/moin/Download .
anonymous_old
I would highly recommend picking up a few books (online or on paper, paper being preferable as it's more credible) on Python. Do not buy "learn Python in X days/months" or something.

You may want to look at Python's official tutorials.

By "amounts(masses?)" the assignment may mean "set" or "list." Does this translate properly?

And "frozenset" perhaps "tuple?"

EDIT: I have to agree with Intermezzo. This doesn't seem very programming oriented.

If you need help programming and have made some progress towards the goal but have hit a roadblock, and have researched the problem without success, post (properly) on StackOverflow. Make sure to tag the question as "python" and "homework." Help should come quickly enough. ;D

</advertisement>
EpicEraser
This is programming oriented.
It's probably an assignment about this:
http://docs.python.org/library/sets.html

The sample code is pretty self explanatory, but if you need help, just ask :)

EDIT: http://docs.python.org/library/stdtypes.html#set would be the correct link. Sorry.
Please sign in to reply.

New reply