This course is designed to teach you the foundations in order to write simple programs in Python using the most common structures. No previous exposure to programming is needed. By the end of this course, you'll understand the benefits of programming in IT roles; be able to write simple programs using Python; figure out how the building blocks of programming fit together; and combine all of this knowledge to solve a complex programming problem.
We'll start off by diving into the basics of writing a computer program. Along the way, you’ll get hands-on experience with programming concepts through interactive exercises and real-world examples. You’ll quickly start to see how computers can perform a multitude of tasks — you just have to write code that tells them what to do.

검토

EZ

A comprehensive course on Python, that lets you explore step by step. This is the best structured python course I have seen in a while. Thanks a lot to the instructor and the course content writer!

TP

May 01, 2020

Filled StarFilled StarFilled StarFilled StarFilled Star

the course was really put together well. and it was a fun-filled project with days of debugging errors and writing codes which i thought was an impossible task for me at the start of the course

수업에서

Final Project

In this module, you'll put everything you've learned so far into action! You'll apply a problem-solving framework to tackle a challenging final project: implementing a script that generates a "word cloud" from some text.

You'll formulate a problem statement to understand the challenge, conduct some research to see what options are available, then begin planning how you intend to solve the problem. Lastly, you'll write the code to implement your solution!

강사:

Google

스크립트

We've come a long way to get here, so let's quickly rattle off what we know so far. We know that we need to process the events to generate a report. We know how to sort the list of events chronologically. We know that we'll store the data in a dictionary of sets, which we'll use to keep track of who's logged in where, and that we'll have a function that generates the dictionary and a separate one that prints the dictionary. I think that's everything. Know what that means? We're finally ready to write our code. Here we go. Let's start by defining the helper function that we'll use to sort the list. We'll use this simple function as the parameter to the sort function to sort the list. Now, we're ready to start coding are processing function, which we will call current users. The first step is to define the function. Inside the function, we'll first sort our events by using the sort method, and passing the function we just created as the key. Now, before we start iterating through our list of events, we need to create the dictionary where we will store the names end users of a machine. Now, we're ready to iterate through our list of events. Next, we want to check if the machine affected by this event is in the dictionary. If it's not, we'll add it with an empty set as the value. Now, for the login events, we want to add the user to the list, and for the logout events, we want to remove users from the list. To do this, we're going to use the add and remove methods, which add and remove elements from a set. Once we are done iterating through the list of events, the dictionary will contain all machines we've seen as keys. With a set containing the current users of the machines as the values, this function returns the dictionary. We'll handle printing in a different function. Nice. We now have the dictionary ready, and we need to print it. For that, we'll create a new function called generate-report. In our report, we want to iterate over the keys and values in the dictionary. To do that, we'll use the method items that returns both the key and the value for each pair in the dictionary. Now, before we print anything, we want to ensure that we don't print any machines where nobody is currently logged in. This could happen if a user logged in and then logged out. To avoid that, we tell the computer only to print when the set of users has more than zero elements. Now, we said earlier that we want to print the machine name, followed by the users logged into the machine, separated by commas. Let's generate the string of logged in users for that machine using the method join. Now, we can generate the string we want using the format method Yeah, we've written all the functions we need to tackle our problem. Did everything makes sense? This is a great moment to pause and review the videos for each step in our approach, from problem statement to writing the code. Make sure it's clear, not just which function we're using, but why we're using it. If anything is a little fuzzy, remember the discussion forums are always there for you to ask for help. It's about to get exciting in the next video. We're going to execute this code and see if it works. I'm feeling good about it. Let's put our code to the test.