Make use of functions to share your favorite cities in the course's final challenge exercise.
(upbeat music) - What's your favorite city? Mine is Santa Barbara, California. I love the food and the amazing landscapes. As you drive through the city, you can see both the mountains and the ocean at the same time. I just love it. So for our final challenge, I'd like you to create a program that prints out the name of your favorite cities, but here's the catch, you need to use at least one function. Your program should meet the following requirements, has a function named favorite_city, favorite_city should have one parameter, name, you should call favorite_city at least three times, the output should include one of my favorite cities is. Remember to have fun and try your best. In the solution video, I'll share how I tackled the problem.
Author
Updated
12/7/2020Released
7/22/2019- Writing source code
- Basic statements and expressions
- Working with numbers and strings
- Writing conditional code
- Increasing your efficiency with functions
- Working with comments
- Making decisions in code
- Troubleshooting errors
- Learning about other languages
Skill Level Beginner
Duration
Views
Related Courses
-
Programming Foundations: Fuzzy Logic
with Erin Colvin41m 50s Intermediate -
Learning Python
with Joe Marini2h 27m Beginner -
Programming Foundations: Algorithms
with Joe Marini1h 45m Beginner -
Programming Foundations: Design Patterns
with Elisabeth Robson1h 44m Intermediate
-
Introduction
-
1. Programming Basics
-
What is programming?2m 52s
-
Writing source code3m 16s
-
Running your code2m 41s
-
Using an IDE3m 21s
-
-
2. Programming Syntax
-
Why Python?1m 52s
-
Installing Python on a Mac4m 19s
-
Installing Python on Windows1m 49s
-
Running Python in an IDE3m 37s
-
Troubleshooting issues4m 2s
-
-
3. Variables and Data Types
-
Variables across languages3m 28s
-
Working with numbers4m 48s
-
Working with strings2m 30s
-
Properly using whitespace4m 22s
-
Working with comments3m 26s
-
Solution: What's the output?5m 14s
-
4. Conditional Code
-
Making decisions in code5m 38s
-
Exploring conditional code4m 49s
-
Challenge: Guessing game1m 11s
-
Solution: Guessing game1m 58s
-
-
5. Modular Code
-
Introduction to functions3m 45s
-
Functions across languages3m 26s
-
Solution: Favorite cities1m 48s
-
-
Conclusion
-
Exploring languages4m 48s
-
Next steps1m 29s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Challenge: Favorite cities