Muutke küpsiste eelistusi

Python for Engineers and Scientists: Concepts and Applications [Kõva köide]

(Chandigarh University, India), (Department of CSE, Vaagdevi Engineering College, India)
  • Formaat: Hardback, 430 pages, kõrgus x laius: 234x156 mm, kaal: 820 g, 27 Tables, black and white; 36 Line drawings, black and white; 2 Halftones, black and white; 2 Illustrations, color; 36 Illustrations, black and white
  • Ilmumisaeg: 19-Dec-2022
  • Kirjastus: CRC Press
  • ISBN-10: 1032111038
  • ISBN-13: 9781032111032
  • Formaat: Hardback, 430 pages, kõrgus x laius: 234x156 mm, kaal: 820 g, 27 Tables, black and white; 36 Line drawings, black and white; 2 Halftones, black and white; 2 Illustrations, color; 36 Illustrations, black and white
  • Ilmumisaeg: 19-Dec-2022
  • Kirjastus: CRC Press
  • ISBN-10: 1032111038
  • ISBN-13: 9781032111032
The text focuses on the basics of Python programming fundamentals and introduction to present-day applications in technology and the upcoming state-of-art trends in a comprehensive manner. The text is based on Python 3.x and it covers the fundamentals of Python with object-oriented concepts having numerous worked-out examples. It provides a learning tool for the students of beginner level as well as for researchers of advanced level. Each chapter contains additional examples that explain the usage of methods/functions discussed in the chapter. It provides numerous programming examples along with their outputs.

The book:





Includes programming tips to highlight the important concepts and help readers avoid common programming errors Provides programming examples along with their outputs to ensure the correctness and help readers in mastering the art of writing efficient Python programs Contains MCQs with their answers; conceptual questions and programming questions; and solutions to some selected programming questions, for every chapter Discusses applications like time zone converter and password generators at the end Covers fundamental of Python up to object oriented concepts including regular expression

The book offers a simple and lucid treatment of concepts supported with illustrations for easy understanding, provides numerous programming examples along with their outputs, and includes programming tips to highlight the important concepts. It will be a valuable resource for senior undergraduate, graduate students, and professionals in the fields of electrical engineering, electronics and communication engineering, and computer engineering.
Foreword xix
Foreword xxi
Preface xxii
Acknowledgments xxv
Authors xxvii
SECTION I Python Fundamentals
Chapter 1 Interaction with Python
3(28)
Learning Objectives
3(1)
1.1 Introduction
3(1)
1.2 Variables and Identifiers
3(5)
1.2.1 How to Name Identifiers
4(1)
1.2.2 Use of Descriptive Identifiers and Comments
4(1)
1.2.3 Variable Types
5(1)
1.2.3.1 Numeric Datatypes
6(1)
1.2.3.2 None Datatype
7(1)
1.2.3.3 Sequence Datatypes
7(1)
1.2.3.4 Set Datatype
7(1)
1.2.3.5 Mapping Datatype
8(1)
1.2.3.6 Array Datatype
8(1)
1.3 Constant
8(2)
1.4 Statement and Expression
10(1)
1.5 Input Statements
10(3)
1.6 Output Statements
13(2)
1.7 Formatting Output Statements
15(10)
1.7.1 Escape Character
15(2)
1.7.2 Sep and End
17(3)
1.7.3 String Formatting with formatf)
20(2)
1.7.4 Numbers Formatting with format()
22(3)
1.8 Comment Statement
25(6)
Multiple Choice Questions
26(2)
Descriptive Questions
28(1)
Programming Questions
28(1)
Answer to Multiple Choice Questions
29(2)
Chapter 2 Operators
31(26)
Learning Objectives
31(1)
2.1 Introduction
31(1)
2.2 Types of Operators
31(19)
2.2.1 Assignment Operator
31(2)
2.2.2 Arithmetic Operators
33(4)
2.2.2.1 Precedence of Arithmetic Operators
37(2)
2.2.3 Relational Operators
39(1)
2.2.4 Logical Operators
40(1)
2.2.4.1 And Operator
40(1)
2.2.4.2 Or Operator
41(1)
2.2.4.3 Not Operator
41(1)
2.2.5 Increment and Decrement Operators
42(1)
2.2.6 Bitwise Operators
42(1)
2.2.6.1 Bitwise AND Operator (&)
42(2)
2.2.6.2 Bitwise OR Operator (|)
44(1)
2.2.6.3 Bitwise XOR Operator (ˆ)
44(1)
2.2.6.4 Bitwise Complement (~)
45(1)
2.2.6.5 Bitwise Left Shift (<<)
46(1)
2.2.6.6 Bitwise Right Shift (>>)
46(1)
2.2.7 Membership Operators
47(1)
2.2.8 Identity Operators
48(2)
2.2.9 Precedence of all Operators
50(1)
2.3 Typecasting
50(7)
Multiple Choice Questions
53(3)
Descriptive Questions
56(1)
Programming Questions
56(1)
Answer to Multiple Choice Questions
56(1)
Chapter 3 Control Structures
57(38)
Learning Objectives
57(1)
3.1 Introduction
57(1)
3.2 Conditional Statements
58(11)
3.2.1 Conditional if-else
58(3)
3.2.2 Conditional if-elif-else
61(4)
3.2.3 Nested if-elif-else Statements
65(1)
3.2.4 Ternary Operator
66(3)
3.3 Loops
69(15)
3.3.1 While-Loop
69(3)
3.3.2 For-Loop
72(2)
3.3.2.1 The range() Function
74(3)
3.3.3 Continue, Break and Pass
77(1)
3.3.3.1 Continue Statement
77(2)
3.3.3.2 Break Statement
79(2)
3.3.3.3 Pass Statement
81(1)
3.3.4 Nested Loops
82(2)
3.4 Loopi ng through two Lists
84(1)
3.5 Iterator
84(11)
Worked Out Examples
86(1)
Multiple Choice Questions
87(5)
Descriptive Questions
92(1)
Programming Questions
92(1)
Answer to Multiple Choice Questions
93(2)
Chapter 4 String
95(32)
Learning Objectives
95(1)
4.1 Introduction
95(1)
4.2 Strings
95(32)
4.2.1 Creating String
96(1)
4.2.1.1 Creating an Empty String
96(1)
4.2.1.2 Creating a String from Numbers
97(1)
4.2.1.3 Creating a String from List and Tuple
97(1)
4.2.2 Accessing String
98(1)
4.2.2.1 Membership in String
99(1)
4.2.3 String Operations
99(1)
4.2.3.1 Concatenation
100(1)
4.2.3.2 Repetition
100(2)
4.2.4 Character Encoding
102(4)
4.2.5 String Functions and Methods
106(1)
4.2.5.1 Len()
106(1)
4.2.5.2 Del()
106(1)
4.2.5.3 Max()
106(1)
4.2.5.4 Min()
107(1)
4.2.5.5 Capitalize()
108(1)
4.2.5.6 Lower()
108(1)
4.2.5.7 Upper()
109(1)
4.2.5.8 Title()
109(1)
4.2.5.9 Replace()
109(1)
4.2.5.10 Split()
110(1)
4.2.5.11 Strip()
111(1)
4.2.5.12 Count()
111(1)
4.2.5.13 Isalpha()
112(1)
4.2.5.14 Isupper()
113(1)
4.2.6 String Slicing
113(1)
4.2.6.1 String Slicing with Negative Index
114(1)
4.2.6.2 String Slicing with Step
115(1)
4.2.6.3 String Slicing Default Index
116(3)
Worked Out Examples
119(1)
Multiple Choice Questions
120(5)
Descriptive Questions
125(1)
Programming Questions
125(1)
Answer to Multiple Choice Questions
126(1)
Chapter 5 List and Tuple
127(56)
Learning Objectives
127(1)
5.1 Introduction
127(1)
5.2 List
127(29)
5.2.1 Creating List
128(1)
5.2.1.1 Creating an Empty List
128(1)
5.2.1.2 Creating a List from a String
128(1)
5.2.1.3 Creating a List by Range Function
128(1)
5.2.1.4 Creating a List from Another List
129(1)
5.2.2 List Operations
130(1)
5.2.2.1 Concatenation (+)
130(1)
5.2.2.2 Repetition (*)
130(1)
5.2.3 Accessing List
130(1)
5.2.3.1 Membership in List
131(1)
5.2.4 List Functions and Methods
132(1)
5.2.4.1.1 Len()
132(1)
5.2.4.1.2 Del()
132(2)
5.2.4.1.3 Max()
134(1)
5.2.4.1.4 Min()
135(1)
5.2.4.1.5 Append()
135(1)
5.2.4.1.6 Insert()
136(1)
5.2.4.1.7 Pop()
136(1)
5.2.4.1.8 Remove()
137(1)
5.2.4.1.9 Extend()
138(1)
5.2.4.1.10 Index()
139(1)
5.2.4.1.11 Count()
139(1)
5.2.4.1.12 Sort()
140(1)
5.2.4.1.13 Sorted()
141(2)
5.2.4.1.14 Reverse()
143(1)
5.2.4.1.15 Copy()
143(1)
5.2.4.1.16 Clear()
144(1)
5.2.4.1.17 Reversed()
144(1)
5.2.4.1.18 Enumerate()
144(1)
5.2.4.1.19 Any()
145(1)
5.2.4.1.20 All()
146(2)
5.2.5 List Slicing
148(1)
5.2.5.1 List Slicing with Negative Index
149(2)
5.2.5.2 List Slicing with Step
151(1)
5.2.5.3 List Slicing Default Index
152(3)
5.2.6 Difference between Assignment and Copying a List
155(1)
5.3 Multi-Dimensional Lists
156(5)
5.3.1 Retrieval from Multi-Dimensional Lists
156(5)
5.4 Tuples
161(7)
5.4.1 Creating a Tuple
161(1)
5.4.1.1 Creating a Tuple with no Item
161(1)
5.4.1.2 Creating a Tuple with a Single Item
162(1)
5.4.1.3 Nesting Tuples
163(1)
5.4.1.4 Creating a Tuple from List
163(1)
5.4.1.5 Creating a Tuple from a String
163(1)
5.4.2 Tuple Operations
164(1)
5.4.2.1 Concatenation (+) Operation
164(1)
5.4.2.2 Repetition (*) Operation
164(1)
5.4.3 Tuple Assignment
165(1)
5.4.4 Accessing Objects in Tuple
166(1)
5.4.4.1 Membership in Tuple
166(1)
5.5.5 Updating Tuples
167(1)
5.4.6 Tuple Functions and Methods
168(1)
5.4.7 Tuple Slicing
168(1)
5.5 Advantages of Tuple over List
168(15)
Multiple Choice Questions - List
170(5)
Multiple Choice Questions - Tuple
175(5)
Descriptive Questions - List
180(1)
Descriptive Questions - Tuple
180(1)
Programming Questions - List
180(1)
Programming Questions - Tuple
181(1)
Answer to Multiple Choice Questions - List
181(1)
Answer to Multiple Choice Questions - Tuple
181(2)
Chapter 6 Dictionary
183(18)
Learning Objectives
183(1)
6.1 Introduction
183(1)
6.2 Dictionaries
183(18)
6.2.1 Creating a Dictionary
184(1)
6.2.1.1 Creating a Dictionary with no item
184(1)
6.2.1.2 Creating a Dictionary with { }
185(1)
6.2.1.3 Creating a Dictionary with dict()
185(1)
6.2.1.4 Creating a Default Dictionary
186(1)
6.2.1.5 Creating a Dictionary from a List
186(1)
6.2.1.6 Insertion of a New Key-Value
186(1)
6.2.2 Dictionary Assignment
187(1)
6.2.3 Accessing Dictionary
187(1)
6.2.3.1 Keys()
188(1)
6.2.3.2 Items()
188(1)
6.2.3.3 Get()
188(2)
6.2.3.4 Membership in Dictionary
190(1)
6.2.4 Dictionary Methods
190(1)
6.2.4.1 Update()
190(2)
6.2.4.2 Sorted()
192(1)
6.2.4.3 Str()
192(1)
6.2.4.4 Setdefault()
192(1)
Worked Out Examples
193(1)
Multiple Choice Questions
194(4)
Descriptive Questions
198(1)
Programming Questions
198(1)
Answer to Multiple Choice Questions
199(2)
Chapter 7 Set
201(20)
Learning Objectives
201(1)
7.1 Introduction
201(1)
7.2 Set
201(20)
7.2.1 Creating a Set
202(1)
7.2.1.1 Creating an Empty Set
202(1)
7.2.1.2 Creating a Set from a List, Tuples and String
203(1)
7.2.1.3 Creating a Set from a Dictionary
203(1)
7.2.2 Accessing Set Elements
204(1)
7.2.2.1 Membership in Set
204(1)
7.2.3 Set Operations
204(1)
7.2.3.1 Union()
205(1)
7.2.3.2 Intersection()
205(1)
7.2.3.3 Difference()
206(1)
7.2.3.4 Exclusive-Or
207(1)
7.2.3.5 Symmetric Difference
208(1)
7.2.3.6 Equivalent Set and Not Equivalent
208(1)
7.2.3.7 Subset and Superset
209(1)
7.2.3.8 Proper Subset and Proper Superset
210(1)
7.2.4 Set Function and Methods
210(1)
7.2.4.1 Add()
211(1)
7.2.4.2 Discard()
211(1)
7.2.4.3 Isdisjoint()
212(1)
7.2.4.4 Issubset()
212(1)
7.2.4.5 Issuperset()
213(1)
7.2.4.6 Frozen Set
213(1)
Worked Out Examples
214(1)
Multiple Choice Questions
215(3)
Descriptive Questions
218(1)
Programming Questions
218(1)
Answer to Multiple Choice Questions
219(2)
Chapter 8 Methods
221(50)
Learning Objectives
221(1)
8.1 Introduction
221(1)
8.2 Functions
221(4)
8.3 Parameterized Function
225(9)
8.3.1 Positional and Keyword Parameters
227(2)
8.3.2 Default Parameter
229(1)
8.3.3 Function with a Variable Number of Arguments
230(4)
8.4 The Return Statement
234(3)
8.5 Namespace and Scope of a Variable
237(4)
8.6 Recursive Function
241(1)
8.7 Lambda Function
242(5)
8.7.1 Filter()
244(1)
8.7.2 Map()
245(1)
8.7.3 Reduce()
246(1)
8.7.4 Zip()
246(1)
8.8 Generators
247(2)
8.9 Python Modules
249(6)
8.9.1 Importing a Module
250(3)
8.9.2 Aliasing
253(1)
8.9.3 User-Defined Module
254(1)
8.10 Closures
255(3)
8.11 Decorators
258(5)
8.11.1 Passing a Parameter to a Decorator
261(1)
8.11.2 Decorator Chaining
262(1)
8.12 Some Special Methods and Attributes
263(8)
8.12.1 Name
263(1)
8.12.2 Module
264(1)
Worked Out Examples
264(1)
Multiple Choice Questions
265(5)
Descriptive Questions
270(1)
Programming Questions
270(1)
Answer to Multiple Choice Questions
270(1)
Chapter 9 File Handling
271(20)
Learning Objectives
271(1)
9.1 Introduction
271(1)
9.2 File IO
271(5)
9.2.1 File Opening and Closing
271(1)
9.2.2 File Properties
272(1)
9.2.3 File Reading
273(1)
9.2.4 File Writing
274(1)
9.2.5 Binary File Reading/Writing
275(1)
9.2.6 CSV File Reading/Writing
275(1)
9.3 File Position
276(2)
9.4 Some More File Operations
278(1)
9.5 Operating System-Related Operations
279(3)
9.6 The "with" Statement
282(1)
9.7 Pickling
282(9)
Worked Out Examples
283(1)
Multiple Choice Questions
284(3)
Descriptive Questions
287(1)
Programming Questions
287(1)
Answer to Multiple Choice Questions
287(4)
SECTION II Object Oriented Concepts in Python
Chapter 10 Classes and Objects
291(46)
Learning Objectives
291(1)
10.1 Introduction to Object-Oriented Programming
291(2)
10.2 Class and Object
293(9)
10.2.1 Defining a Class
293(1)
10.2.2 Generating an Object
294(1)
10.2.3 The init_(), new_() and del_() Methods
295(1)
10.2.3.1 Init_()
296(2)
10.2.3.2 New_()
298(2)
10.2.3.3 Del_()
300(2)
10.3 Variables and Methods
302(8)
10.3.1 Variables (Attributes)
302(1)
10.3.1.1 Object Variables (Instance Variables)
303(2)
10.3.1.2 Class Variables (Static Variables)
305(3)
10.3.2 Accessing Variables
308(1)
10.3.2.1 Accessing the Variable by Object Reference
308(1)
10.3.2.2 Accessing the Variable by Class Name
309(1)
10.3.2.3 Accessing the Static Variable Outside the Class by Class Name
310(1)
10.4 Public, Private and Protected Variables
310(4)
10.4.1 Variable Starts Without Any (Underscore) Symbol
310(1)
10.4.2 Variable Starts with (Single Underscore) Symbol
311(1)
10.4.3 Variable Starts with (Two Underscores) symbols
312(2)
10.5 Methods
314(3)
10.5.1 Instance Method
314(1)
10.5.2 Class Method
315(1)
10.5.3 Static Method
316(1)
10.6 Class Inside a Class (Inner Class)
317(4)
10.6.1 Object of the Inner Class Is Created Inside the Outer Class
317(1)
10.6.2 Object of the Inner Class Is Created Outside the Outer Class
318(1)
10.6.3 Accessing Attributes of Inner Class
318(1)
10.6.3.1 Accessing the Attributes of Inner Class Outside the Class
319(1)
10.6.3.2 Accessing the Attributes of Inner Class in the Outer Class
319(1)
10.6.3.3 Accessing the Attributes of Inner Class Outside the Outer Class
320(1)
10.6.3.4 Accessing the Attributes of Inner Class When Inner Class and Outer Class Have the Same Method
320(1)
10.7 Some Special Methods and Attributes
321(16)
10.7.1 Dict_()
321(1)
10.7.2 Name_()
322(1)
10.7.3 Doc
323(1)
10.7.4 Hasattr()
324(1)
10.7.5 Getattr()
324(1)
10.7.6 Setattr(obj, name, value)
325(1)
10.7.7 Delattro
326(1)
10.7.8 Del
327(1)
10.7.9 Isinstance()
328(1)
10.7.10 Repr()
329(1)
Worked Out Examples
329(2)
Multiple Choice Questions
331(4)
Descriptive Questions
335(1)
Programming Questions
335(1)
Answer to Multiple Choice Questions
335(2)
Chapter 11 Inheritance
337(28)
Learning Objectives
337(1)
11.1 Introduction
337(8)
11.1.1 Single-Level inheritance
338(2)
11.1.2 Multi-Level Inheritance
340(2)
11.1.3 Multiple Inheritance
342(2)
11.1.4 Hierarchical Inheritance
344(1)
11.1.5 Hybrid inheritance
345(1)
11.2 Initialization in Inheritance
345(5)
11.2.1 Init_() for the Child Class Only Is Defined
346(1)
11.2.2 Init_() for the Base Class Only Is Defined
346(1)
11.2.3 Init_() for Both Sub Class and Super Class Is Denned
347(3)
11.3 Method Resolution Order
350(5)
11.4 Specialized Methods
355(10)
11.4.1 Issubclass()
355(1)
11.4.2 Bases
355(1)
Worked Out Examples
356(1)
Multiple Choice Questions
357(5)
Descriptive Questions
362(1)
Programming Questions
363(1)
Answer to Multiple Choice Questions
363(2)
Chapter 12 Polymorphism
365(20)
Learning Objectives
365(1)
12.1 Introduction
365(11)
12.1.1 Duck-Typing
367(3)
12.1.2 Operator Overloading
370(2)
12.1.3 Method Overloading
372(2)
12.1.4 Method Overriding
374(2)
12.2 Encapsulation
376(9)
Worked Out Examples
379(1)
Multiple Choice Questions
380(4)
Descriptive Questions
384(1)
Programming Questions
384(1)
Answer to Multiple Choice Questions
384(1)
Chapter 13 Abstract Class, Aggregation, Composition
385(18)
Learning Objectives
385(1)
13.1 Introduction - Abstract Class
385(1)
13.2 Abstract Class and Abstract Method
385(3)
13.3 Relationship
388(8)
13.3.1 Association Relationship
388(2)
13.3.2 Aggregation (Uses a) Relationship
390(3)
13.3.3 Composition (Has a) Relationship
393(3)
13.4 Difference between Inheritance and Association
396(1)
13.5 Difference between Aggregation and Composition
396(7)
Worked Out Examples
396(2)
Multiple Choice Questions
398(3)
Descriptive Questions
401(1)
Programming Questions
401(1)
Answer to Multiple Choice Questions
401(2)
Chapter 14 Exception Handling
403(24)
Learning Objectives
403(1)
14.1 Errors and Exceptions
403(1)
14.2 The try:, except:, else: and finally: Block
404(6)
14.2.1 The try: and except: Block
405(1)
14.2.2 The try:, except: and else: Block
406(2)
14.2.3 The try:, except:, else: and finally: Block
408(1)
14.2.4 Mentioning the Error Description
409(1)
14.3 The Exception Hierarchy
410(5)
14.4 Exception in a Function
415(1)
14.5 The Raised Exception
416(2)
14.6 User Defined Exceptions
418(2)
14.7 Assertion
420(7)
Worked Out Examples
421(1)
Multiple Choice Questions
421(4)
Descriptive Questions
425(1)
Programming Questions
425(1)
Answer to Multiple Choice Questions
426(1)
Index 427
Dr. Rakesh Nayak, author of two text books, is currently a professor in the Department of Computer Science and Engineering at O. P. Jindal University, Raigarh, Chhattisgarh, India. He earned his Masters degree in Computer Applications from Indira Gandhi National Open University in the year 2007 and MTech in computer science and engineering from Acharya Nagarjuna University, Andhra Pradesh, India in 2010 and his PhD degree in Computer Science from Behrampur University, Odisha, India in 2013. Prior to joining the computer science department of O. P. Jindal University in January 2022, he worked in various capacities in different Engineering/MCA colleges. He has more than 22 years of teaching experience and has guided 11 MTech students. He has many publications in international journals to his credit.

Dr. Nishu Gupta is a senior member, IEEE. He is a postdoctoral fellow in the Smart Wireless Systems (SWS) Research Group at Norwegian University of Science and Technology (NTNU), located in Gjøvik, Norway. Before this position, he was an assistant professor in the Electronics and Communication Engineering department, College of Engineering and Technology, SRM Institute of Science and Technology, Chennai, India. He earned his PhD degree from Motilal Nehru National Institute of Technology Allahabad, Prayagraj, India, which is an Institute of National Importance as declared by the Govt. of India. He has authored and edited several books with international publishers such as Taylor & Francis, Springer, Wiley, Scrivener, among others. Dr. Nishu is on the editorial board of various International reputed journals and transactions. Dr. Nishu serves as an active reviewer in various highly reputed journals such as IEEE Transactions on ITS, IEEE Access, IET Communications and many more. He is a recipient of the Best Paper Presentation Award during an International Conference at Nanyang Technological University, Singapore. His research interests include Autonomous Vehicles, Edge Computing, Augmented Intelligence, Internet of Things, Internet of Vehicles, Deep Learning, Machine Learning, Ad-Hoc Networks, Vehicular Communication, Driving Efficiency, Cognitive Computing, and Human-Machine Interaction.