Lab3003
  • FacultyAlgorithmChallenge
  • README
  • Question Bank
  • Python Documentation
    • BetterMap
    • Board
    • Card
    • Circle
    • Deck
    • README.md
    • Guide For Bookmarklet
    • Hand
    • HashMap
    • Hist
    • Kangaroo
    • LinearMap
    • Markov
    • Point
    • PokerDeck
    • PokerHand
    • Rectangle
    • State
    • Test
    • ThinkPython
    • ThinkPython2
    • Time
    • Think Python
    • thinkpython
  • Files
  • Image Files
  • lab
    • InsertSortTDD
    • countingBits
    • cs3003mergeSortLectureGuideLine
    • index_min
    • insort
    • One-line factorial function in Python
  • Manual for Python Lab
    • COURSE OBJECTIVES
    • 1_timelines
    • FDPNotes
    • PC-2_Python
    • lab1-kgashok.py
    • Lab 10 :Matrix Multiplication
    • Lab 11: Programs that take command line arguments (word count)
    • Lab 11: Programs that take command line arguments
    • Lab 12: Compute the most frequently used words from the text file
    • Lab 12: Find the most frequent words in a text read from a file
    • Lab 12a: File content sorter
    • Lab 2: Find the square root of a number (Newton’s method)
    • Lab 3: Compute power of a number (Exponentiation)
    • Lab 3: Exponentiation (power of a number)
    • lab4-binaraysearch-anvar.py
    • Solution for Binary Search
    • lab4-joelanandraj-binarysearch.py
    • Lab 4: Linear and Binary Search
    • lab4-lin-anvar.py
    • Linear Searcher
    • Lab 5 : find n prime numbers
    • lab6-kgashok.py
    • lab7-kgashok.py
    • lab8-kgashok.py
    • Lab 8: Selection and Insertion sort using Python
    • Merge Sort
    • Quick Sort
    • labSheet
    • pc0
    • sortPythonic
    • Sorting
  • misc
    • Bookmarklets
    • Guide For Bookmarklet
    • pythonResources
    • FDP for Python
    • Agenda for Workshop
      • Agenda
  • notes
    • Problem Set
    • InsertSortTDD
    • MergeSort
    • cs3003-unit1-notes
    • cs3003-unit3
    • cs3003-unit4-examples
    • Unit 4 Lists, Tuples and Dictionaries
    • cs3003insertsortLectureGuide
    • cs3003mergeSortLectureGuideLine
    • Designing and Delivering Effective Lectures
    • histogram.py
    • selectSortLectureGuide
  • Sandbox to try ThinkPy2 code
    • Code from ThinkPython Github repository
  • Important Topics
    • 3003-syllabus
    • GE8161 PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY L T P C
    • Unit II Version 2
    • Unit IV material
    • UNIT III CONTROL FLOW, FUNCTIONS
    • Unit 1 Algorithm Problem Solving
    • Unit_V_Notes
    • UpdatedSyllabus
    • glossary
    • glossaryGeneration.py
    • importantTopics-kgashok
    • memCSV
    • Tower of Hanoi
    • Notes for Unit 2 - Illustrative programs
    • unit5-updated_notes
    • unit_1_notes
    • Unit 3 Control Flow Version 1
    • unit 3
      • UNIT III CONTROL FLOW, FUNCTIONS
    • unit_i_img
Powered by GitBook
On this page
  • Cheat Sheets
  • List of programs
  • Platform needed
  • COURSE Outcomes
  • Bonus Lab GTG
  1. Manual for Python Lab

COURSE OBJECTIVES

PreviousManual for Python LabNext1_timelines

Last updated 3 years ago

To write, test, and debug simple Python programs.
To implement Python programs with conditionals and loops.
Use functions for structuring Python programs.
Represent compound data using Python lists, tuples, dictionaries.
Read and write data from/to files in Python.

Cheat Sheets

  • - main page for all cheatsheets

  • - beginner Python cheatsheet (variables, strings, etc)

  • - cheat sheet for conditionals (if and while statements)

  • - cheat sheet for functions (functions)

  • - cheatsheet for unit testing (unit testing)

List of programs

Concept
Sequence
Objective

Learn Python in 10 minutes

lab 0.0

Waterloo, CodingBat

lab 0.1

Problem sets

lab 0.2

Swap two numbers (variables), test for Leap Year (conditional), cycle through n variables, and sum of array of numbers (loops)

Algorithmic, Tuples, Modulo Arithmetic, Global Scope (vs) Local Scope, Indefinite looping (while keyword), if-else statements, Recursion

lab 1

Compute the GCD of two numbers

Algorithmic - same as above

lab 2

Find the square root of a number (Newton’s method)

Algorithmic

lab 3

Exponentiation (power of a number)

Algorithmic, Searching, Subscripting

lab 4

Linear search and Binary search

Algorithmic

lab 5

First n prime numbers

Lists

lab 6

Find the maximum of a list of numbers

Lists, Dictionaries

lab 7

Removing all the duplicate elements in a list

Looping through Lists, Sorting

lab 8

Selection sort, Insertion sort

Sorting (divide-and-conquer)

lab 9

Merge sort, Quick sort

Mutable data - List of Lists

lab 10

Multiply matrices

Mutable data - Dictionary, main() function, sys module, getopt function, Basic error handling

lab 11

Programs that take command line arguments (word count, aka Unix command wc)

Dictionary, File Handling, Exceptions, Formatted Writing

lab 12

Find the most frequent words in a text read from a file

Advanced

Lab Integration

Advanced

Lab Integration2

Read personal GPS data from file and plot on a map and find the distance from home to KITE

Platform needed

  • Python 3 interpreter for Windows/Linux

  • Total: 60 Periods

COURSE Outcomes

Upon completion of the course, students will be able to

  • Write, test, and debug simple Python programs.

  • Implement Python programs with conditionals and loops.

  • Develop Python programs step-wise by defining functions and calling them.

  • Use Python lists, tuples, dictionaries for representing compound data.

  • Read and write data from/to files in Python.

Bonus Lab GTG

  • Genius Project - choose an open source project of your choice from github. If you are mechanical engineer, choose a project that is related to your discipline. Make a serious attempt to understand 100% of the logic of the code.

    • Make changes to the code to improve the efficiency or effectiveness or create meaningful extensions.

    • Pre-register with your faculty to indicate that you want to complete this project with mentoring help

    • If you win the Python Genius Project Competition which will be held in the week of Sept 6, 2017, you will be awarded a prize for the best GTG Project, worth upto Rs 10,000

Blockly Challenge and Turtle Graphics, Read

7 constructs, 140 CloudCoder exercises,

Solve the CloudCoder problem at . Maximum points for the most elegant solution, aka one that is both efficient and one that is also easy to understand.

For Inspiration review -

Think up a creative use of a Python script that you would like to use on your mobile. Create a personal Mobile App using Python to implement it -

http://j.mp/pythonCrashCS
http://bit.ly/beginnerCS
http://bit.ly/conditionalCS
http://bit.ly/functionCS
http://bit.ly/testingCS
https://www.python.org/about/success/
https://www.quora.com/Can-I-make-an-Android-app-with-Python
http://qpython.com/
http://bit.ly/python10
Python workshop
http://cloudcoder.kgkite.ac.in/cloudcoder/#exercise?c=7,p=1229