- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
9 Posted Topics
Changing the 5th dictionary element to: [CODE]5:["False", "5)Exit"][/CODE] or [CODE]5:["None", "5)Exit"][/CODE] seems to the the trick. From what I quickly read about the eval() function is that it runs the expression you give it in string format, or something similar to this. Since a blank line was giving it trouble …
If by user input line of code you mean going back to choosing an equation without having to leave the program then just move [CODE]d=raw_input("choose equation")[/CODE] into the while loop. Maybe throw a 5th option in there that lets you break out of the loop for when you're done and …
Voidz, if what you're referring to is an IDE(Integrated Development Enviorment) (e.g. Eclipse, Visual Studio, NetBeans etc..) then no you do not need an IDE to begin programming in python. Python comes with everything it needs to run "right out of the box" when you download it from [URL="http://www.python.org"]Python.org[/URL]. If …
There's this neat website: [url]http://www.pythonchallenge.com/[/url]. As the name states, it's python challenges. It can be pretty fun at times, and if you're ever stuck you can check out their forum for hints and tips on which modules you should be using etc.
I'm not sure if this is what you want but: [CODE]protein="GWEIQPYVWDECYRVFYEQLNEEHKKIFKGIFDCIRDNSAPNLATLVRVTTNHFTHEQAMMDAVKFSEVLPHKKMHRDFLEKLGGLSAPVDNHIKGTDFKYKGKAKNVDYCKEWLVL" pp="LLCCCCCCCCCCCCCCCCCCHHHHHHHHHHHHHHHHHCHHHHHHHHHHHHHHCCCCHHHHHHHCLLLCCCCCHHHHHHHHHHHHHHHHHHHCCCCCCCCCCCHHHHHHHHHHHHCCL" gor="cccccccccccchhhhhhhhhhhhhhhhhhhhhhhccccccccceeeeecccccchhhhhhhhhhhcccchhhhhhhhhhhhhccccccccccccccccccccccceeceeccceec" aber="CCCCCCCCCCCCHHHHHHHCCHHHCHHHHHHHHHHCCCCHHHHHHHHHHHCCCCCCHHHHHHHCCCCCCCHCCHHHHHHHHHHCCCCCCCCCCCCCCCCCCCCCCCCCHHHHHHHCC" for i in range(len(protein)): print i+1,protein[i], pp[i], gor[i], aber[i], #<---- extra comma here [/CODE] Enter in one extra comma after your final statement. Hmm, actually I just re-read your question "How can I print it so …
Found an old thread dealing with this: [URL="http://www.daniweb.com/software-development/python/threads/268973"]http://www.daniweb.com/software-development/python/threads/268973[/URL]. It is a windows only solution and I am not currently under windows so I can't test it.
Edit the post and put all that code inside the code tags, it'll make it easier for others to help you.
Sorry for my ignorance, but when you're passing an array like you showed: "{A,67,9,0,B,D}" are the characters in that array actually the ASCII codes? If so then would the array look like: {65,67,9,0,66,68}?
And if you don't exactly know if the number that will be output is a whole number you can check with something like: [CODE] if(x - (int)x == 0){ cout << (int)x << endl; } [/CODE] Although, I'm not sure if a whole number will always be represented as "x.0", …
The End.
inputbear