Posts

Showing posts from April, 2022

Programming in Python CST 362 KTU CS Sixth Semester Elective Notes

About Me Syllabus About the Course Programming in Python CST 362 KTU University Question Papers and Answer Keys  Module 1:Programming Environment and Python Basics 1.Introduction to Python 2.Running Python Program- IDLE,Interactive Shell, Jupyter notebook 3.Identifiers, variables and keywords 4.Basic Python data types- numbers and strings, type conversion 5.Operators 6.Operator precedence and expression evaluation 7.Input and output- input() and print() 8.Formatting Text - Case Study 9.Built-in functions, modules and packages 10.The software development process 11.Simple programs to begin with, comments and statements 12.Basic Programs to try 13.Programs using built-in functions and modules For more Sample Programs ( contact) Control statements  14.Selection statement -if else,if elif, match case sample programs 15.Programs to Try using if else 16.Looping statements- while and for 17.break, continue and pass statements 18.nested loops 19.Sample programs using loops and nested loops 20.

Syllabus Programming in Python CST 362 KTU

SYLLABUS Module -1 (Programming Environment and Python Basics) (6 hours) Getting started with Python programming – Interactive shell, IDLE, iPython Notebooks, Detecting and correcting syntax errors, How Python works. The software development process –A case study. Basic coding skills – strings, assignment, and comments, Numeric data types and character sets, Expressions, Using inbuilt functions and modules. Control statements – Iteration with for/while loop, Formatting text for output, A case study, Selection structure (if-else, switchcase), Conditional iteration with while, A case study, Testing control statements, Lazy evaluation. Module -2 (Building Python Programs) (8 hours) Strings and text files – Accessing characters, substrings, Data encryption, Strings and number system, String methods, Text files, A case study on text analysis. Design with Functions – Functions as abstraction Mechanisms, Problem solving with top-down design, Design with recursive functions, Managing a program

Formatting Text-Case study

Image
Request Write a program that computes an investment report. Analysis The inputs to this program are the following: An initial amount to be invested (a floating-point number) A period of years (an integer) An interest rate (a percentage expressed as an integer) The program uses a simplified form of compound interest, in which the interest is computed once each year and added to the total amount invested. The output of the program is a report in tabular form that shows, for each year in the term of the investment, the year number, the initial balance in the account for that year, the interest earned for that year, and the ending balance for that year. The columns of the table are suitably labeled with a header in the first row. Following the output of the table, the program prints the total amount of the investment balance and the total amount of interest earned for the period. The proposed user interface is shown below Design The four principal parts of the program perform the following