Boston Python Workshop 6/Friday/CodingBat Using Codingbat: Difference between revisions

imported>Jesstess
No edit summary
imported>Jesstess
Line 7:
CodingBat is a little different from using Python at the command line or in a text editor like we've been doing. When you use CodingBat, you type your code into a web page and click 'Go' when you want that code to run. You'll still need to make sure you indent all your code to the same level.
 
TheFor wayeach CodingBat worksquestion, isyou that yourwill write a function (the first line of the function is written for you), and. CodingBat will run your function with a few times, each time with a different input.inputs, CodingBatand will look atcompare the output of yourthe function andyou comparewrote to what it toknows is the correct answer. If all the outputs are correct for all the inputs, you'reve written the function donecorrectly!
 
We like CodingBat because it gives immediate feedback.
Let's walk through an example; in this case I'll use [http://codingbat.com/prob/p216579 the sumTwoNumbers] exercise.
 
Let's walk through an example;. inIn this case I'll use [http://codingbat.com/prob/p216579 the sumTwoNumbers] exercise.
 
Here's the first screen we see:
Anonymous user