From the course: Python Theory for Network Engineers
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Solution: Functionalize network tasks - Python Tutorial
From the course: Python Theory for Network Engineers
Solution: Functionalize network tasks
- Oh, right. Let's go build that function. Let me go ahead and copy the initial code and then copy into this file called challenge three final. And I'm going to delete all the comments and I'm going to use dev show version as my function name. So what I want is the IP, the username and... password. Correct? And after I define it, everything below this would be the block of code that I want to execute. So I'm just going to indent that and I copy then press tab to have the same indentation on all of them. So what I have right here is I wanted to use the IP... address of that input, right? So if I just plus those and I concatenate those strings by combining all those strings and the username would be referring to the username that's passed in. And then the password is the password that has passed in. Right? So what is hopefully clear is this first username is the variable name, and then the second…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.