Movatterモバイル変換


[0]ホーム

URL:


Packt
Search iconClose icon
Search icon CANCEL
Subscription
0
Cart icon
Your Cart(0 item)
Close icon
You have no products in your basket yet
Save more on your purchases!discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Profile icon
Account
Close icon

Change country

Modal Close icon
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timerSALE ENDS IN
0Days
:
00Hours
:
00Minutes
:
00Seconds
Home> Programming> Programming Language> Learn Python Programming
Learn Python Programming
Learn Python Programming

Learn Python Programming: The no-nonsense, beginner's guide to programming, data science, and web development with Python 3.7 , Second Edition

Arrow left icon
Profile Icon Romano
Arrow right icon
$32.99$36.99
Full star iconFull star iconFull star iconFull star iconHalf star icon4.1(28 Ratings)
eBookJun 2018508 pages2nd Edition
eBook
$32.99 $36.99
Paperback
$45.99
Subscription
Free Trial
Renews at $19.99p/m
eBook
$32.99 $36.99
Paperback
$45.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature iconInstant access to your Digital eBook purchase
Product feature icon Download this book inEPUB andPDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature iconDRM FREE - Read whenever, wherever and however you want
Product feature iconAI Assistant (beta) to help accelerate your learning
OR

Contact Details

Modal Close icon
Payment Processing...
tickCompleted

Billing Address

Table of content iconView table of contentsPreview book icon Preview Book

Learn Python Programming

Built-in Data Types

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."
– Sherlock Holmes – The Adventure of the Copper Beeches

Everything you do with a computer is managing data. Data comes in many different shapes and flavors. It's the music you listen to, the movies you stream, the PDFs you open. Even the source of the chapter you're reading at this very moment is just a file, whichis data.

Data can be simple, an integer number to represent an age, or complex, like an order placed on a website. It can be about a single object or about a collection of them. Data can even be about data, that is, metadata. Data that describes the design of other data structures or data that describes application data or its context. In Python,objects are abstraction for data, and Python has an amazing variety of data...

Everything is an object

Before we delve into the specifics, I want you to be very clear about objects in Python, so let's talk a little bit more about them. As we already said, everything in Python is an object. But what really happens when you type an instruction likeage = 42 in a Python module?

If you go tohttp://pythontutor.com/, you can type that instruction into a text box and get its visual representation. Keep this website in mind; it's very useful to consolidate your understanding of what goes on behind the scenes.

So, what happens is that an object is created. It gets anid, thetype is set toint (integer number), and thevalue to42. A nameage is placed in the global namespace, pointing to that object. Therefore, whenever we are in the global namespace, after the execution of that line, we can retrieve that object by simply accessing it through its name...

Mutable or immutable? That is the question

A first fundamental distinction that Python makes on data is about whether or not the value of an object changes. If the value can change, the object is calledmutable, while if the value cannot change, the object is calledimmutable.

It is very important that you understand the distinction between mutable and immutable because it affects the code you write, so here's a question:

>>> age = 42
>>> age
42
>>> age = 43 #A
>>> age
43

In the preceding code, on the line#A, have I changed the value of age? Well, no. But now it's43 (I hear you say...). Yes, it's43, but42 was an integer number, of the typeint, which is immutable. So, what happened is really that on the first line,age is a name that is set to point to anint object, whose value is42. When we typeage = 43, what happens is that...

Set types

Python also provides two set types,set andfrozenset. Theset type is mutable, whilefrozenset is immutable. They are unordered collections of immutable objects.Hashability is a characteristic that allows an object to be used as a set member as well as a key for a dictionary, as we'll see very soon.

From the official documentation:An object is hashable if it has a hash value which never changes during its lifetime, and can be compared to other objects. Hashability makes an object usable as a dictionary key and a set member, because these data structures use the hash value internally. All of Python’s immutable built-in objects are hashable while mutable containers are not.

Objects that compare equally must have the same hash value. Sets are very commonly used to test for membership, so let's introduce thein operator in the following example:

>...

The collections module

When Python general purpose built-in containers (tuple,list,set, anddict) aren't enough, we can find specialized container datatypes in thecollections module. They are:

Data typeDescription

namedtuple()

Factory function for creating tuple subclasses with named fields

deque

List-like container with fast appends and pops on either end

ChainMap

Dictionary-like class for creating a single view of multiple mappings

Counter

Dictionary subclass for counting hashable objects

OrderedDict

Dictionary subclass that remembers the order entries were added

defaultdict

Dictionary subclass that calls a factory function to supply missing values

UserDict

Wrapper around dictionary objects for easier dictionary subclassing

UserList

Wrapper around list objects for easier list subclassing

UserString

Wrapper around...

Summary

In this chapter, we've explored the built-in data types of Python. We've seen how many there are and how much can be achieved by just using them in different combinations.

We've seen number types, sequences, sets, mappings, collections(and a special guest appearance byEnum), we've seen that everything is an object, we've learned the difference between mutable and immutable, and we've also learned about slicing and indexing (and, proudly, negative indexing as well).

We've presented simple examples, but there's much more that you can learn about this subject, so stick your nose into the official documentation and explore.

Most of all, I encourage you to try out all the exercises by yourself, get your fingers using that code, build some muscle memory, and experiment, experiment, experiment. Learn what happens when you divide by zero...

Key benefits

  • Learn the fundamentals of Python programming with interactive projects
  • Apply Python to data science with tools such as IPython and Jupyter
  • Utilize Python for web development and build a real-world app using Django

Description

Learn Python Programming is a quick, thorough, and practical introduction to Python - an extremely flexible and powerful programming language that can be applied to many disciplines.Unlike other books, it doesn't bore you with elaborate explanations of the basics but gets you up-and-running, using the language. You will begin by learning the fundamentals of Python so that you have a rock-solid foundation to build upon.You will explore the foundations of Python programming and learn how Python can be manipulated to achieve results. Explore different programming paradigms and find the best approach to a situation; understand how to carry out performance optimization and effective debugging; control the flow of a program; and utilize an interchange format to exchange data. You'll also walk through cryptographic services in Python and understand secure tokens.Learn Python Programming will give you a thorough understanding of the Python language. You'll learn how to write programs, build websites, and work with data by harnessing Python's renowned data science libraries. Filled with real-world examples and projects, the book covers various types of applications, and concludes by building real-world projects based on the concepts you have learned.

Who is this book for?

Learn Python Programming is for individuals with relatively little experience in coding or Python. It's also ideal for aspiring programmers who need to write scripts or programs to accomplish tasks. The book shows you how to create a full-fledged application.

What you will learn

  • Get Python up and running on Windows, Mac, and Linux
  • Explore fundamental concepts of coding using data structures and control flow
  • Write elegant, reusable, and efficient code in any situation
  • Understand when to use the functional or OOP approach
  • Cover the basics of security and concurrent/asynchronous programming
  • Create bulletproof, reliable software by writing tests
  • Build a simple website in Django
  • Fetch, clean, and manipulate data

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Languages :

What do you get with eBook?

Product feature iconInstant access to your Digital eBook purchase
Product feature icon Download this book inEPUB andPDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature iconDRM FREE - Read whenever, wherever and however you want
Product feature iconAI Assistant (beta) to help accelerate your learning
OR

Contact Details

Modal Close icon
Payment Processing...
tickCompleted

Billing Address

Product Details

Publication date :Jun 29, 2018
Length:508 pages
Edition :2nd
Language :English
ISBN-13 :9781788991650
Category :
Languages :
Concepts :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99billed monthly
Feature tick iconUnlimited access to Packt's library of 7,000+ practical books and videos
Feature tick iconConstantly refreshed with 50+ new titles a month
Feature tick iconExclusive Early access to books as they're written
Feature tick iconSolve problems while you work with advanced search and reference features
Feature tick iconOffline reading on the mobile app
Feature tick iconSimple pricing, no contract
$199.99billed annually
Feature tick iconUnlimited access to Packt's library of 7,000+ practical books and videos
Feature tick iconConstantly refreshed with 50+ new titles a month
Feature tick iconExclusive Early access to books as they're written
Feature tick iconSolve problems while you work with advanced search and reference features
Feature tick iconOffline reading on the mobile app
Feature tick iconChoose a DRM-free eBook or Video every month to keep
Feature tick iconPLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick iconExclusive print discounts
$279.99billed in 18 months
Feature tick iconUnlimited access to Packt's library of 7,000+ practical books and videos
Feature tick iconConstantly refreshed with 50+ new titles a month
Feature tick iconExclusive Early access to books as they're written
Feature tick iconSolve problems while you work with advanced search and reference features
Feature tick iconOffline reading on the mobile app
Feature tick iconChoose a DRM-free eBook or Video every month to keep
Feature tick iconPLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick iconExclusive print discounts

Frequently bought together


Learn Python Programming
Learn Python Programming
Read more
Jun 2018508 pages
Full star icon4.1 (28)
eBook
eBook
$32.99$36.99
$45.99
Python 3 Object-Oriented Programming
Python 3 Object-Oriented Programming
Read more
Oct 2018466 pages
Full star icon4.3 (30)
eBook
eBook
$32.99$36.99
$45.99
Learn Programming in Python with Cody Jackson
Learn Programming in Python with Cody Jackson
Read more
Nov 2018304 pages
Full star icon4 (4)
eBook
eBook
$26.98$29.99
$38.99
Stars icon
Total$130.97
Learn Python Programming
$45.99
Python 3 Object-Oriented Programming
$45.99
Learn Programming in Python with Cody Jackson
$38.99
Total$130.97Stars icon

Table of Contents

15 Chapters
A Gentle Introduction to PythonChevron down iconChevron up icon
A Gentle Introduction to Python
A proper introduction
Enter the Python
About Python
What are the drawbacks?
Who is using Python today?
Setting up the environment
Installing Python
How you can run a Python program
How is Python code organized?
Python's execution model
Guidelines on how to write good code
The Python culture
A note on IDEs
Summary
Built-in Data TypesChevron down iconChevron up icon
Built-in Data Types
Everything is an object
Mutable or immutable? That is the question
Numbers
Immutable sequences
Mutable sequences
Set types
Mapping types – dictionaries
The collections module
Enums
Final considerations
Summary
Iterating and Making DecisionsChevron down iconChevron up icon
Iterating and Making Decisions
Conditional programming
Looping
Putting all this together
A quick peek at the itertools module
Summary
Functions, the Building Blocks of CodeChevron down iconChevron up icon
Functions, the Building Blocks of Code
Why use functions?
Scopes and name resolution
Input parameters
Return values
A few useful tips
Recursive functions
Anonymous functions
Function attributes
Built-in functions
One final example
Documenting your code
Importing objects
Summary
Saving Time and MemoryChevron down iconChevron up icon
Saving Time and Memory
The map, zip, and filter functions
Comprehensions
Generators
Some performance considerations
Don't overdo comprehensions and generators
Name localization
Generation behavior in built-ins
One last example
Summary
OOP, Decorators, and IteratorsChevron down iconChevron up icon
OOP, Decorators, and Iterators
Decorators
Object-oriented programming (OOP)
Writing a custom iterator
Summary
Files and Data PersistenceChevron down iconChevron up icon
Files and Data Persistence
Working with files and directories
Data interchange formats
IO, streams, and requests
Persisting data on disk
Summary
Testing, Profiling, and Dealing with ExceptionsChevron down iconChevron up icon
Testing, Profiling, and Dealing with Exceptions
Testing your application
Test-driven development
Exceptions
Profiling Python
Summary
Cryptography and TokensChevron down iconChevron up icon
Cryptography and Tokens
The need for cryptography
Hashlib
Secrets
HMAC
JSON Web Tokens
Useful references
Summary
Concurrent ExecutionChevron down iconChevron up icon
Concurrent Execution
Concurrency versus parallelism
Threads and processes – an overview
Concurrent execution in Python
Case examples
Summary
Debugging and TroubleshootingChevron down iconChevron up icon
Debugging and Troubleshooting
Debugging techniques
Troubleshooting guidelines
Summary
GUIs and ScriptsChevron down iconChevron up icon
GUIs and Scripts
First approach – scripting
Second approach – a GUI application
Where do we go from here?
Summary
Data ScienceChevron down iconChevron up icon
Data Science
IPython and Jupyter Notebook
Dealing with data
Where do we go from here?
Summary
Web DevelopmentChevron down iconChevron up icon
Web Development
What is the web?
How does the web work?
The Django web framework
A regex website
The future of web development
Summary
Farewell
Other Books You May EnjoyChevron down iconChevron up icon
Other Books You May Enjoy
Leave a review - let other readers know what you think

Recommendations for you

Left arrow icon
Debunking C++ Myths
Debunking C++ Myths
Read more
Dec 2024226 pages
eBook
eBook
$27.99$31.99
$39.99
Go Recipes for Developers
Go Recipes for Developers
Read more
Dec 2024350 pages
eBook
eBook
$27.99$31.99
$39.99
50 Algorithms Every Programmer Should Know
50 Algorithms Every Programmer Should Know
Read more
Sep 2023538 pages
Full star icon4.5 (68)
eBook
eBook
$35.98$39.99
$49.99
Asynchronous Programming with C++
Asynchronous Programming with C++
Read more
Nov 2024424 pages
Full star icon5 (1)
eBook
eBook
$29.99$33.99
$41.99
Modern CMake for C++
Modern CMake for C++
Read more
May 2024502 pages
Full star icon4.7 (12)
eBook
eBook
$35.98$39.99
$49.99
Learn Python Programming
Learn Python Programming
Read more
Nov 2024616 pages
Full star icon5 (1)
eBook
eBook
$31.99$35.99
$39.99
Learn to Code with Rust
Learn to Code with Rust
Read more
Nov 202457hrs 40mins
Video
Video
$74.99
Modern Python Cookbook
Modern Python Cookbook
Read more
Jul 2024818 pages
Full star icon4.9 (21)
eBook
eBook
$38.99$43.99
$54.99
Right arrow icon

Customer reviews

Top Reviews
Rating distribution
Full star iconFull star iconFull star iconFull star iconHalf star icon4.1
(28 Ratings)
5 star60.7%
4 star14.3%
3 star7.1%
2 star10.7%
1 star7.1%
Filter icon Filter
Top Reviews

Filter reviews by




DieChemieMay 30, 2020
Full star iconFull star iconFull star iconFull star iconFull star icon5
I've been going through the book as a non-programmer beginner. I ran through another book on Python syntax first and this was my next step forward. I have a few thoughts on the book I'll share.1. The book is definitely oriented towards people with a computer science/programming background.2. However, if you have a high tolerance for not understanding everything it is a lovely introduction to a GREAT many concepts. I really think the author does a great job giving you an intro into many/most applications of Python.3. This is a book on professional Python programming. Which is good and bad depending on you. If you are interested in using this professionally then I think this book would be great for you. Fabrizio is clearly a professional and his insights into skills and habits needed to program effectively are very valuable and delivered in a memorable way. If you are just interested in writing some ugly scribble that gets the job done inefficiently, you may find these insights distracting/time-consuming from your quest of learning the basics.4. Lastly, to get the most out of the book you really need to take your time and practice the concepts. Learning anything requires remembering/testing your knowledge and if you just 'read' the book there are very few tests, only examples. I'll admit I have rushed through a lot of it. Likely I will now try to use the concepts to take on projects and review/study topics in more depth going forward.Final thought: I think the book has been very challenging for me. Likely I could have found a slightly more beginner friendly book to do first. However, I still think this has been fantastic and now that I have suffered through many of the chapters I feel MUCH MUCH more knowledgeable of thinking like a programmer, the fundamental philosophies of Python (Fabrizio's strongest teaching point), and moving forward to focus both on mastering needed concepts and studying the Python disciplines I'm most interested in to do projects.
Amazon Verified reviewAmazon
mindy19Feb 21, 2020
Full star iconFull star iconFull star iconFull star iconFull star icon5
Bought this for my Grandson for his studies at University, loves it!
Amazon Verified reviewAmazon
MatthewMay 08, 2019
Full star iconFull star iconFull star iconFull star iconFull star icon5
Setting up a IDE environment and learning Python, I use to use Perl so I hope this book works to re-fire my memory.
Amazon Verified reviewAmazon
Martin SmithAug 11, 2019
Full star iconFull star iconFull star iconFull star iconFull star icon5
I find books by this publisher are very hit and miss but this one is definitely a hit for me.I've been programming for more than 10 years but totally new to Python and found for me the book was paced well and structured well and covered a good breadth of the topic. I also enjoyed the enthusiasm with which the subject matter was presented and occasional dashes of humour to keep things from getting too dry.
Amazon Verified reviewAmazon
VigneshJan 11, 2021
Full star iconFull star iconFull star iconFull star iconFull star icon5
Book print quality is good.
Amazon Verified reviewAmazon
  • Arrow left icon Previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • ...
  • Arrow right icon Next

People who bought this also bought

Left arrow icon
50 Algorithms Every Programmer Should Know
50 Algorithms Every Programmer Should Know
Read more
Sep 2023538 pages
Full star icon4.5 (68)
eBook
eBook
$35.98$39.99
$49.99
Event-Driven Architecture in Golang
Event-Driven Architecture in Golang
Read more
Nov 2022384 pages
Full star icon4.9 (11)
eBook
eBook
$35.98$39.99
$49.99
The Python Workshop Second Edition
The Python Workshop Second Edition
Read more
Nov 2022600 pages
Full star icon4.6 (22)
eBook
eBook
$36.99$41.99
$51.99
Template Metaprogramming with C++
Template Metaprogramming with C++
Read more
Aug 2022480 pages
Full star icon4.6 (14)
eBook
eBook
$33.99$37.99
$46.99
Domain-Driven Design with Golang
Domain-Driven Design with Golang
Read more
Dec 2022204 pages
Full star icon4.4 (19)
eBook
eBook
$31.99$35.99
$44.99
Right arrow icon

About the author

Profile icon Romano
Romano
Fabrizio Romano was born in Italy in 1975. He holds a master's degree in Computer Science Engineering from the University of Padova. He's been working as a professional software developer since 1999. Fabrizio has been part of Sohonet's Product Team since 2016. In 2020, the Television Academy honored them with an Emmy Award in Engineering Development for advancing remote collaboration.
Read more
See other products by Romano
Getfree access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook?Chevron down iconChevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website?Chevron down iconChevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook?Chevron down iconChevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support?Chevron down iconChevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks?Chevron down iconChevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook?Chevron down iconChevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.


[8]ページ先頭

©2009-2025 Movatter.jp