Posts

Python For Engineers CST 445 KTU Open Elective Notes S7 - Dr Binu V P 9847390760

About Me About the Course and Syllabus Model Question Paper Python For Engineers CST 445 University Question Paper- Python For Engineers CST 445 -Jan 2023 University Question Paper- Python For Engineers CST 445 -May 2023 ( supl) University Question Paper- Python For Engineers CST 445- Jan 2024  University Question Paper-Python For Engineers CST 445- June 2024(supl) Module 1:Basics of Python  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.Built-in functions, modules and packages 9.The software development process 10.Simple programs to begin with, comments and statements 11.Basic Programs to try 12.Programs using built-in functions and modules 13.Sample Programs ( contact) Control statements  14.Selection statement -if else- sample programs 15

Model Question Paper CST 445 KTU Python For Engineers

  APJ ABDUL KALAM TECHNOLOGICAL UNIVERSITY SEVENTH SEMESTER B.TECH DEGREE EXAMINATION, MONTH & YEAR Course Code: CST445                                              Course name : PYTHON FOR ENGINEERS Max Marks: 100                                                                                                               Duration: 3 Hours PART-A (Answer All Questions. Each question carries 3 marks) 1. Explain the basic data types available in Python, with examples. 2. Write a Python program to reverse a number and also find the sum of digits of the number.Prompt the user for input. 3. Compare tuples, lists, and dictionaries. 4. Explain the concept of scope and lifetime of variables in Python programming language, with a suitable example. 5. What is polymorphism? Give an example in the context of OOP in Python. 6. How is exception handling accomplished in Python programs? 7. Describe the characteristics of the CSV format. 8. Plot the function y = 3x^2 for −1 ≤ x ≤ 3 as a continuou

University Question Papers and Scheme CST 445 Python For Engineers

 

Syllabus CST 445 Python For Engineers

CST445 PYTHON FOR ENGINEERS CATEGORY  L T P CREDIT      YEAR OF INTRODUCTION OEC                  2  1 0   3                     2019 Preamble: The objective of the course is to provide learners an insight into Python programming in a scientific computation context and develop programming skills to solve engineering problems. It covers programming environment, important instructions, data representations, intermediate level features, Object Oriented Programming and file data processing of Python. This course lays the foundation to scientific computing, develop web applications, Machine Learning, and Artificial Intelligence-based applications and tools, Data Science and Data Visualization applications.   Prerequisite: NIL Note : Students who have successfully completed CST 283 - Python for Machine Learning (Minor) are not eligible to opt this course. Mark Distribution Total Marks      CIEMarks      ESE Marks      ESE Duration 150

More advanced graphical output

Image
 Here, we will learn a more advanced syntax that harnesses the full power of matplotlib. It gives the user more options and greater control. import numpy as np import matplotlib.pyplot as plt # Define the sinc function, with output for x=0 # defined as a special case to avoid division by zero def s(x):      a = np.where(x == 0., 1., np.sin(x)/x)      return a x=np.arange(0., 10., 0.1) y=np.exp(x) t=np.linspace(-15., 15., 150) z=s(t) # create a figure window fig = plt.figure(figsize=(9, 7)) # subplot: linear plot of exponential ax1 = fig.add_subplot(2, 2, 1) ax1.plot(x, y, 'C0') ax1.set_xlabel('time (ms)') ax1.set_ylabel('distance (mm)') ax1.set_title('exponential') #subplot: semi-log plot of exponential ax2 = fig.add_subplot(2, 2, 2) ax2.plot(x, y, 'C2') ax2.set_yscale('log') # ax2.semilogy(x, y, 'C2') # same as 2 previous lines ax2.set_xlabel('time (ms)') ax2.set_ylabel('distance (mm)') ax2.set_title('exponent

Mathematics and Greek symbols

Image
matplotlib can display mathematical formulas, Greek letters, and mathematical symbols using a math rendering module known as mathtext. The mathtext module parses a subset of Donald Knuth’s TEX mathematical typesetting language, and provides basic mathematical typesetting without any software other than matplotlib. If, in addition, you have TEX (and/or LATEX) as a separate standalone program (such as MacTex [TexShop] or MiKTeX), then you can do even more. In what follows we will assume that you are using the native matplotlib mathtext, but will make a few comments applicable to those who have a separate installation of LATEX. matplotlib’s mathtext can display Greek letters and mathematical symbols using the syntax of TEX. If you are familiar with TEX or LATEX, you have hardly anything to learn. Even if you are not familiar with them, the syntax is simple enough that you can employ it in most cases without too much effort.You designate text as mathtext by placing dollar signs (dollar)

Structure of matplotlib

Image
In this section, we provide an overview of the logical structure of matplotlib. This will help you better understand the matplotlib syntax. matplotlib is a Python module for generating graphical output to your computer screen or to a computer file. Fundamentally, its job is to translate Python scripts into graphical instructions that your computer can understand. It does this using two different layers of software, the backend layer and the artist layer. To these two layers it adds a scripting layer , PyPlot, which we have met already (import matplotlib.pyplot as plt). PyPlot is a convenience layer, and not really necessary, but it facilitates rapid scripting, and aids with portability. As you shall see, for most programming we advocate using a hybrid of the scripting and artist layers. Figure below portrays the matplotlib software hierarchy. The backend layer For the sake of being concrete, we’ll start by considering the task of creating a figure on your computer screen. matplotlib