PC-2_Python

Problem Set PC-2

  • PC-1 assessment http://j.mp/greet10CC

  • Always think on paper, first! Pattern problem - http://j.mp/ctreeCC

  • Warm up 1 - http://j.mp/secondBiggest and http://j.mp/secondBiggestValue

  • Warm up 2 - http://j.mp/fizzBuzzC and http://j.mp/fizzBuzzMixC on CyberDojo

Learn TDD the fun way

Step 1

  • Sequence practice http://j.mp/indexMinCC and http://j.mp/twoPoints

    • How to calculate total route distance over multiple points?

    • Which taxi to dispatch?

  • String practice http://j.mp/rotateCC

  • Lab practice - http://j.mp/tileSolverCC

    • perfect for learning the application of an algorithm. Interestingly, the solution can be reduced to one line, which incidentally, can also be a non-typical python code statement.

Step 2

  • Dictionary concepts http://j.mp/reverseDictionary

    • How to maintain a list in alphabetical order?

    • and http://j.mp/luckyNumCC and http://j.mp/duplicateCountCC

  • Conditional practice and Argument handling http://j.mp/cycleThrough3

  • Loop (3 ways) through Lists http://j.mp/getMaxCC

Bonus

  • http://j.mp/selfConverge - first iteration mode, and then recursion mode - because it will require default argument values.

  • http://j.mp/spyPlaneCD - come with the most elegant code for this

  • http://j.mp/permutePython and/or on CyberDojo

  • http://j.mp/friendsCC - friends of friends

  • http://j.mp/unionListCC - merge two lists into one, remove duplicates

Further Steps

  • Lab Practice - http://j.mp/transposeCC and/or http://j.mp/matrixMultiplyCC

  • Lab Practice - http://j.mp/selectionSortCC and/or http://j.mp/selectSortChallenge on CD

  • Lab Practice - http://j.mp/insertionSortCC

Advanced

The "Thala-Ajith" movie ticketing challenge. Pick an avatar at http://j.mp/ticketsCD

Phase 1: Just solve the problem. Phase 2: What if we had some new denominations to the choices?

Misc

  • subset and subseq equivalent in Python - http://j.mp/subProblems

    • pangram - determine whether a sentence is a pangram

    • http://bit.ly/subsetSubseq - for contrasting between subset, substring and subsequence

  • find whether a string has duplicates

    • determine whether a string is an isogram

Misc 2

  • partial pangrams

  • higher order isograms

Misc 3

  • codify the substring search algorithm Knuth-Morris-Pratt

    • https://j.mp/kmpAlgorithmVideo by NPTEL

Motivations

  • PC2 is all about learning a threshold concept (pointers in C, problem solving using TDD in Python, patterns like MVC in C++/Java, promises in JavaScript)

  • Perceptual adaptive learning module (PALM) is the intended pedagogy

    • How does this compare to Nifty Assignments from SIGCSE?

  • PC2 is a progressive challenging set of problems to use for practicing TDD skills on a regular basis. New ways of thinking can be ingrained into one's repertoire of skills only when they are practiced regularly.

  • PC2 is useful for refreshing the novice programmer about the syntax of the language, including some of the unique and important constructs and basic data types of the Python language, including *kwargs, dictionaries, etc.

  • PC2 is useful as an assessment tool to validate whether students have really internalized the 1st semester paper of CS3003.

  • What is this anyway?

    • It is all about threshold concepts, and how to learn it. "Learn how to learn" is another takeaway!

  • PC2 (past the Misc sections) persuades you to choose an algorithm (for e.g. KMP algorithm) of your choice, and really become passionate about it!

If You Are a Student Interested in a Software Job…

Dorai Thodla

If you are a student and is really interested in a software job, some actual practice may help. Here are a few things you can do:

  • Just learning the standard languages they teach you in your institution is not enough. Practice and feel the joy of programming. You will know whether you like it or not. If you enjoy it, it will show, when you talk to people about it.

  • Start early – even in the very first year of your college. Just spend a few hours each week.

  • Pick an easy language to learn like Python or Ruby.

  • Learn to program by writing lots of small useful tools, games, apps. Visit https://github.com/kgisl/project-ideas

  • Share your programs with others and ask for feedback. Ask them whether they find it useful.

  • Share the code on github (it is free) or other repositories.

  • Post the link on Geek forums and request feedback too (but please don’t spam the groups). Put your github link in your profile, email signature and on your resume.

  • Don’t get upset if people criticize it. All feedback is good when you are learning.

  • Don’t take it personally. If some one cares enough to look at it and give you comments, that is a good thing.

  • Once in a while, take all the stuff you have written, factor out common code and create libraries/modules that you can reuse. Go back and change the programs to reuse these libraries. Repeat 2-6 as many times as you can, every week, every month.

  • Look at some cool open source projects and join in. Contribute in a small way. Keep exploring.

  • When you attend tech interviews, tell them about the stuff you have written. Point them to the links. Share the feedback your received and your journey of learning and iterating.

  • Don’t worry that if you train in programming language X but the job is for Y that you may not qualify.

  • Except in a few cases, companies are trying to hire smart people with lots of initiative, who are willing to constantly learn and explore.

  • It may be a good idea to earn while you learn. It is not just the money, but it is the feeling that someone values what you have done enough to pay for it.

  • Find a master programmer to work with. How do you know they are masters? Pretty simple. Take a piece of code they have written and read it. It will read like an essay – elegant, beautiful and clear.

  • A couple of years of apprentice with such great programmers will do more to accelerate your learning than any other activity.

Last updated