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.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Applied Computational Thinking with Python

You're reading from   Applied Computational Thinking with Python Design algorithmic solutions for complex and challenging real-world problems

Arrow left icon
Product type Paperback
Published in Nov 2020
Publisher Packt
ISBN-13 9781839219436
Length 420 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Authors (2):
Arrow left icon
Dayrene Martinez Dayrene Martinez
Author Profile Icon Dayrene Martinez
Dayrene Martinez
Sofía De Jesús Sofía De Jesús
Author Profile Icon Sofía De Jesús
Sofía De Jesús
Arrow right icon
View More author details
Toc

Table of Contents (21) Chapters Close

Preface 1. Section 1: Introduction to Computational Thinking
2. Chapter 1: Fundamentals of Computer Science FREE CHAPTER 3. Chapter 2: Elements of Computational Thinking 4. Chapter 3: Understanding Algorithms and Algorithmic Thinking 5. Chapter 4: Understanding Logical Reasoning 6. Chapter 5: Exploring Problem Analysis 7. Chapter 6: Designing Solutions and Solution Processes 8. Chapter 7: Identifying Challenges within Solutions 9. Section 2:Applying Python and Computational Thinking
10. Chapter 8: Introduction to Python 11. Chapter 9: Understanding Input and Output to Design a Solution Algorithm 12. Chapter 10: Control Flow 13. Chapter 11: Using Computational Thinking and Python in Simple Challenges 14. Section 3:Data Processing, Analysis, and Applications Using Computational Thinking and Python
15. Chapter 12: Using Python in Experimental and Data Analysis Problems 16. Chapter 13: Using Classification and Clusters 17. Chapter 14: Using Computational Thinking and Python in Statistical Analysis 18. Chapter 15: Applied Computational Thinking Problems 19. Chapter 16: Advanced Applied Computational Thinking Problems 20. Other Books You May Enjoy

Using Boolean logic and operators

Boolean logic refers to the operators, namely, and, or, and not in Python. You'll recall seeing this in the brief discussion on truth tables earlier in this chapter. As we'll see next, we use the same logical processing when writing the algorithms, even if the tables are not explicitly stated or used. When solving computational thinking problems, we sometimes have to meet multiple conditions at once. Let's look at this using just language for now.

Let's sort some fruit. If the fruit is round and orange, green, or yellow, it will be sorted into group 1. If the fruit is not round, but is orange, green, or yellow, it will be sorted into group 2. If the fruit doesn't match those requirements, it goes into group 3. Let's simplify these groups:

  • Group 1: Round AND (orange OR green OR yellow)
  • Group 2: Not round AND (orange OR green OR yellow)
  • Group 3: All other fruit

I know I stated the round condition...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image