Let's start by reading in the CSV file and looking at the first few lines of the file: (In this data set, we have changed the names to protect the privacy of Dataquest staffers). The data set is stored in the CSV file "tacos.csv", and you can download it here if you'd like to follow along with this tutorial. We'll be doing some analysis of data from HeyTaco to answer some basic questions about people's giving habits. You can give a taco to someone to show your gratitude with a message, like this: We'll be learning how to use Python if else while working with a dataset that summarizes virtual tacos used within Dataquest's online chat for a specific month.Īt Dataquest, we give virtual tacos in Slack (using HeyTaco) as a way of saying thank you or rewarding colleagues on a job well done. If you aren't comfortable with those yet, we recommend this free and interactive Python Fundamentals course, which teaches all of these (and Python if else as well!) We're assuming you already know a few Python basics such as:īasic Python types like lists, strings and integers In this tutorial, you'll learn how to use Python if else to control your code. The if else syntax is one of the most important pieces of Python syntax that you'll learn. The Python if else commands act like a digital traffic cop, letting you define blocks of code that run when certain conditions are met. When programming, controlling the flow of what code is run under what circumstance is extremely important.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |