How would i go about converting a simple guessing game i made in C into a pep8 program?
How would i go about converting a simple guessing game i made in C into a pep8 program?
a google search for PEP8 came up with two major results for the definition of PEP8
1. A code style standard for python.
2. A CPU (possibly not a real one?) used in several assembly language courses.
to which one are you referring?
the first one
I would use a C compiler, if available and instruct it to output assembly code instead of object or executable code.
failing that, I would break the program down into a set of very basic operations and implement each one, along with the logic that goes with it. do you know PEP/8 assembly language? if not, you'll likely need to learn it first, unless you have access to a C compiler that can generate PEP/8 code.
Eh, since by "pep8" you mean "A code style standard for python", then the right question to ask is:
How would i go about converting a simple guessing game i made in C into a Python program?
Styling your Python code according to the guidelines in PEP-8 is secondary to the task at hand.
Anyway, the answer is: you translate what the C program does into Python. This does not necessarily mean line by line conversion, and sometimes it is easier to just write the Python program from scratch then use the C program to help verify the Python program's correctness.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
wow, I must have been really tired when I last posted. I gave the answer as if the OP had said "the second one," and for that I apologize.