Python Workbook: Learn How to Quickly and Effectively Program with Exercises, Projects, and Solutions by PROGRAMMING LANGUAGES ACADEMY
Author:PROGRAMMING LANGUAGES ACADEMY [LANGUAGES ACADEMY, PROGRAMMING]
Language: eng
Format: azw3
Published: 2019-12-28T16:00:00+00:00
Is This Correct? - Part 4
Q-1: Below is a user-made function that is designed to iterate through a given range and look for the highest number. Will the function work when it is called?
def high_number(numbers):
max = numbers[0]
for number in numbers:
if number < max:
max = number
return max
list = [21, 200, 31, 1, 39]
high_number(list)
Q-2: What seems to be the issue with the following?
def this_function():
print("Hello From This Function!")
this_function_with_args(name, greeting):
print(f"Hello {name}, From This Function!, I wish you {greeting}")
this_function()
this_function_with_args()
Q-3: What would this function do?
def plus(a,b):
sum = a + b
(sum, a)
sum, a = plus(3,4)
print(sum)
Q-4: Can you place a loop within a function as shown below?
def plus(*args):
total = 0
for i in args:
total += i
return total
print(plus(20,30,40,50))
Now that we have revisited quite a few concepts and methods, and functions as well, let us head over to our final project and see what it is all about.
Final Project – Hangman
Remember the old game called Hangman? The one that involved blanks and a limited number of guesses to guess a movie, a name, a person, a city or something else? For your final project, I decided to come up with a tough one. A project that will use almost everything you have learned.
To make it even better, if you execute the program correctly, you can store it as a recallable function or create a separate package so that you can use this over and over again. While there are hundreds of variations for this game online, use your own unique approach. Feel free to browse the internet to get some inspiration.
Requirements:
You will need to use the following as your first line:
import time
Let this be a project that you are proud of, once it is finished. By the end of this project, rest assured you are ready to take on the challenges and offer some exquisite programming skills to those who require programmers such as yourself.
The journey of a programmer does not end here. There are far too many things that lay ahead which you will need to keep pace with. Learn about various libraries, modules and packages to see how they can bring refinement to your projects.
For those interested in Machine Learning, Automation, Artificial intelligence and Deep Learning, you will come across some names like Scikit-Learn, Turtle and a few more. While it is still too early to jump into these, it is a good idea to have a look at them and see how they perform in action.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(12510)
Hello! Python by Anthony Briggs(9860)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9748)
The Mikado Method by Ola Ellnestam Daniel Brolund(9740)
Dependency Injection in .NET by Mark Seemann(9286)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8251)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7733)
Grails in Action by Glen Smith Peter Ledbrook(7660)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7508)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(6724)
Microservices with Go by Alexander Shuiskov(6488)
Practical Design Patterns for Java Developers by Miroslav Wengner(6391)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6371)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6365)
Angular Projects - Third Edition by Aristeidis Bampakos(5744)
The Art of Crafting User Stories by The Art of Crafting User Stories(5281)
NetSuite for Consultants - Second Edition by Peter Ries(5223)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5039)
Kotlin in Action by Dmitry Jemerov(5012)
