Ask your own question, for FREE!
Computer Science 14 Online
OpenStudy (anonymous):

Hi everyone... It has been 18 years since I left high school (year 12), and I did pass Maths B (harder maths), chemistry etc.., and believe it or not, I was coding in C (basic stuff) when I was 15-16 (self taught... back then there was no internet, and had to rely on libraries with text books), I know that Python is an easy language, but I am having difficulty understanding some concepts... (e.g what the len() function actually does)... my question is.... If I am finding it a bit hard now, then clearly I am going to struggle later.... or is a matter of being new to a language, it is always hard at the start? Will it become easier in time on I wrap my head around it? BTW I am attempting exercises on Codecademy which I understand is very basic as it is...

OpenStudy (anonymous):

ok I get the len() function now.... this is my problem.... I think the Codeacademy may be a bit buggy as it is saying I earnt an award for completing the exercise, but still returns an error.. http://dpaste.com/1350206/

OpenStudy (e.mccormick):

Missing a +

OpenStudy (e.mccormick):

The print str(now.month) line is missing a + before str(now.second)

OpenStudy (e.mccormick):

http://dpaste.com/1350208/

OpenStudy (anonymous):

I think I may have to go and repeat all the exercises as I clearly am forgetting something... I have spent 2-3 hours on this one exercise now and its getting a little old.... its talking about using concatenation to add the spaces, but I'm sure that it hasn't taught me yet how to do this... http://img547.imageshack.us/img547/8264/5j0e.jpg Should I use an alternative website? Is there a better one? What do you coders do when you are frustrated? take a break or something?

OpenStudy (preetha):

Come here to ask questions. Also many users in Math know something about programming and can help you there as well. Good luck.

OpenStudy (anonymous):

I mean, should I be using a different website other than Code Academy, I will of course be coming here to ask questions... i love this website....

OpenStudy (e.mccormick):

Look at the spacing.

OpenStudy (e.mccormick):

I computer programming there are three types of errors: compile errors, linking error, and run time errors. They are generally easy to difficult to find in the same order. A compile error is generally easiest to find because the compiler says, "Hey! Line number such and such has a problem! Fix it!" This may be a problem at that line or before it. So it does not always tell you exactly where to look, but it helps a lot. It also usually says the type of error, such as syntax or type mismatch. As you learn the terminology, these are easier and easier to find and fix. A linking error means the software compiled just fine. Then it tried to link together with the other parts needed and something was missing, corrupt, or incompatible. Generally these are seen as compile errors by a programmer working in an integrated environment. From a technical standpoint they are very different, but the result is the same. The linker generally says what sub type of error and and where it happened, which makes it reasonably easy to find. These are generally very small spelling errors and many times do not get any special underlining in an IDE, so not as easy as compile time ones... but close!. Run time errors are the pain in the anatomy ones. A run time error is not detected until a particular part of a program runs in a way that creates the error AND someone notices it. One of the more serious run time errors was in the control module for radiation therapy machines. http://www.ccnr.org/fatal_dose.html So, there was a small mistake that nobody caught until 4 or 5 people died! Other errors are as simple as trying to divide by zero and the program crashes. These almost never tell you where in the software they are happening. A user may do input in one part of the program and cause a problem in another. These can be very separate... as an example, not from reality, say that some guy dialing a wrong number in California and it causes power to go out in Texas. The physical distance would make it so that people were looking for a problem in Texas and not realize it was some input in California. In software, this is really like someone puts in numbers that happen to cancel, or puts in a name that gets used later as a number, and these oddities cause the program to spit out bad answers, crash, or do almost anything between. Your error was of this third type. A space in the wrong place. Your output is fine for a computer and even looks OK in a passing glance, but it is wrong.

OpenStudy (e.mccormick):

Learning to find and deal with small errors is the most frustrating AND most important part of computer programming. The only way to learn to fix mistakes it to make them and fix them. Therefore, it does not matter where you learn to code. No matter what, you will have to deal with this. The advantage of Code Academy is that it is checking the output for you and giving you some clues. That is better than not even knowing you got it wrong.

OpenStudy (anonymous):

e. mccormick.... you are an absolute GODSEND!!!..... The information you have provided is second to none.... I think my approach has been wrong.... My previous career involved lots of problem solving, but was VERY flexible in its approach where there were many rules set, but occasionally its OK to break them in order to achieve the desired outcome.... it appears that programming involves a completely different mindset, and I need to train my brain to accomodate this... (I was not only a Tank Commander, but also an instructor at Duntroon, Canberra at Royal Military College.... the US equivalent would be WestPoint, and SandHurst in the UK). You have answered my questions clearly and you have great communication, and are able to impart concepts and idea's to a high standard... I don't know what you do in life, but you will be successful.... I think I will obtain some books on the subject, and read up... then attempt more exercises. The thing is, I will be up against 18-19 year olds next February at University who will be fresh out of High School, so I need to cram Maths, learn elements of Unix (from scratch), C# and Python. I have written to my future lecturer who has recommended these subjects. If I don't do this, I fear I will be absolutely 'THRASHED' by my peers when I start classes. I guess my only advantage is the mindset which I gained from the Army (never give up) attitude, and the 'will to win'. As you have probably read in previous posts, I have knowledge on subjects that 99.9% will never gain or know, and whilst I cannot impart specific information... I am able to impart general information.... so I have plans in the future to create something (i dont know what this is yet), which I'm sure will be of benefit to people. Again your information is of a high calibre and I whilst I'm sure we will be having future conversations, I again thank you whole-heartedly, and wish you a fine day Sir!!!

OpenStudy (e.mccormick):

In the military mindset, computers are like that one drill instructor that wanted to prove the old line about, "There is a right way, a wrong way, and the Army Way. From now on you do the Army Way!" It seems like not much leeway and screams at you when anything is wrong... but once you learn it, you find out that there are really multiple ways to do things. It is just the range is, "The Computer Way." If you want a good computer science mid set, there is a book called "Think Python How to Think Like a Computer Scientist" I can highly recommend. The electronic version is 100% free and it was designed by university professors for Uni and Secondary school use as an intro to computer science through Python. http://www.greenteapress.com/thinkpython/ In conjunction with this, watch the videos for the MIT 6.00SC class. http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00sc-introduction-to-computer-science-and-programming-spring-2011/index.htm Prof. Guttag has a lot of tips on debugging in there and devotes an entire lecture to it at one point. Both of these will work well with Python 2.7.x Also, the Code Academy parts you are doing will make a useful complement to this. They are also using the 2.x type language and give instant feedback.

OpenStudy (e.mccormick):

Why professors are loving Python for intro classes is because it is almost everything. It is almost an object orientated language, so it can be used to teach object orientated programming. (Almost because they refused to implement a small handful of OOP principals that they disagree with.) It is almost a script language, so it teaches scripting. It is almost universally portable, meaning your students can easily learn on a LINUX, Mac OS, or Windows based system with equal ease. It is basically a latecomer to the programming scene that took advantage of knowing about many of the best and worst things in programming, so it took from the best and avoided the worst. Also, it is based on an educational programming language, so parts of the core principals were always made with education needs in mind. For example, it is exceptionally clear to read because it demands proper formatting or it will not run.

OpenStudy (anonymous):

Mate.. you're too much! (you're awesome)... I have a alot of reading to do and the 'fatal dose' story was quite sobering...... I just have another question... I know Windows is a crap OS (despite most of the world thinking its the best), but since I don't have the resources at present to setup another system on Unix etc (which I know nothing about), can you please guide me as to the best version to install on my humble Win7 x32 system?... from what I have read, 2.7.5 would be the best option at present..... http://python.org/download/ I suspect it would be this one... but not entirely certain.... Python 2.7.5 Windows X86-64 Installer (Windows AMD64 / Intel 64 / X86-64 binary [1] -- does not include source Thanks for your patience... I know how frustrating it is to teach noobs.... I imagine it would be trying to teach a chimpanzee calculus through a series of screeches and squeals... lol (banging head against the wall stuff)

OpenStudy (anonymous):

Anyone?^^^^

OpenStudy (e.mccormick):

You said " Win7 x32 system" If you really have a 32 bit system, then "Python 2.7.5 Windows X86-64 Installer (Windows AMD64 / Intel 64 / X86-64 binary [1] -- does not include source " is the wrong one. The issue is that is the 64 bit version. If your Win7 is actually 64 bit, which is likely, then it is the right one. As for the Windows OS, I have used a very wide range of OSes. I used to have a list... but if I went to base OSes and don't include different versions of the same OS, I would come in at about 9 or 10. In all that, I have to say that Windows as an OS has been one of the better ones. Now, I do have major gripes with Microsoft, like many of the stupid changes they have made that make it very hard to support people over the phone because where they go for what changes from version to version, and I fully agree that they have some serious quality control issues in basic programming techniques which has lead to lots of vulnerabilities. I am not going to say they are great, but having used all those others, I find them to be the most practical. I wanted to do a few things on LINUX and set up a system. Next, I found the free software that would do what I wanted. This had a dependency list, so I had to find a bunch of other things. Then the problems happened. It turned out that there were incompatibilities between versions and I needed to recompile a bunch of things from the source. The entire thing I was trying to do in LINUX died when I had to modify source code based on comments because it was the only way to get things to work.... all for something that comes with Windows out of the box. Other times I have used LINUX, I found the graphical interface to be just as buggy and prone to crashes as Windows' is. It was just less likely to need a full OS reboot to get going again. Do I use LINUX? Yes. Every day. As a server that has command prompt only. Works wonderfully that way. Other than Windows 8, it is hard to beat Windows when it comes to something you can easily install things on and just use. Even Apple violated the Einsteinian principals of simplicity by trying to go so simple that it was actually harder to do things rather than easier. Their one button mouse went too far because it forced people to use both hands to do a huge assortment of things a two button mouse lets people do with one hand.

OpenStudy (anonymous):

Once again, very informative... I check my OS and it is indeed Win7 x64.... Thanks again for taking the time McCormick!

OpenStudy (e.mccormick):

np. Have fun!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!