Notice: add_option was called with an argument that is deprecated since version 2.3.0 with no alternative available. in /home/xfivhjwectmq/public_html/olutolaobembe.com/wp-includes/functions.php on line 4088

Notice: The called constructor method for WP_Widget in Woo_AdWidget is deprecated since version 4.3.0! Use
__construct()
instead. in /home/xfivhjwectmq/public_html/olutolaobembe.com/wp-includes/functions.php on line 3956

Notice: The called constructor method for WP_Widget in Woo_BlogAuthorInfo is deprecated since version 4.3.0! Use
__construct()
instead. in /home/xfivhjwectmq/public_html/olutolaobembe.com/wp-includes/functions.php on line 3956

Notice: The called constructor method for WP_Widget in Woo_EmbedWidget is deprecated since version 4.3.0! Use
__construct()
instead. in /home/xfivhjwectmq/public_html/olutolaobembe.com/wp-includes/functions.php on line 3956

Notice: The called constructor method for WP_Widget in Woo_flickr is deprecated since version 4.3.0! Use
__construct()
instead. in /home/xfivhjwectmq/public_html/olutolaobembe.com/wp-includes/functions.php on line 3956

Notice: The called constructor method for WP_Widget in Woo_Search is deprecated since version 4.3.0! Use
__construct()
instead. in /home/xfivhjwectmq/public_html/olutolaobembe.com/wp-includes/functions.php on line 3956

Notice: The called constructor method for WP_Widget in Woo_Twitter is deprecated since version 4.3.0! Use
__construct()
instead. in /home/xfivhjwectmq/public_html/olutolaobembe.com/wp-includes/functions.php on line 3956

Notice: The called constructor method for WP_Widget in Woo_Subscribe is deprecated since version 4.3.0! Use
__construct()
instead. in /home/xfivhjwectmq/public_html/olutolaobembe.com/wp-includes/functions.php on line 3956

Notice: The called constructor method for WP_Widget in Woo_ContactUs is deprecated since version 4.3.0! Use
__construct()
instead. in /home/xfivhjwectmq/public_html/olutolaobembe.com/wp-includes/functions.php on line 3956

Notice: The called constructor method for WP_Widget in Woo_Widget_WooTabs is deprecated since version 4.3.0! Use
__construct()
instead. in /home/xfivhjwectmq/public_html/olutolaobembe.com/wp-includes/functions.php on line 3956

Notice: The called constructor method for WP_Widget in Woo_Widget_Feedback is deprecated since version 4.3.0! Use
__construct()
instead. in /home/xfivhjwectmq/public_html/olutolaobembe.com/wp-includes/functions.php on line 3956

Notice: The called constructor method for WP_Widget in Woo_Widget_Component is deprecated since version 4.3.0! Use
__construct()
instead. in /home/xfivhjwectmq/public_html/olutolaobembe.com/wp-includes/functions.php on line 3956
The Python Learner: SpyGame | Olutola Michael Obembe

The Python Learner: SpyGame

So i have decided to learn Python and after reading functions, I was giving the spygame test, I decided not to cheat and try it out … took a little while but I found my own way around it. Before you pros out there Judge me… I am 4 days old in the game so forgive the learners idea ….

CHALLENGING PROBLEMS

SPY GAME: Write a function that takes in a list of integers and returns True if it contains 007 in order

 spy_game([1,2,4,0,0,7,5]) --> True
 spy_game([1,0,2,4,0,5,7]) --> True
 spy_game([1,7,2,0,4,5,0]) --> False

 

And here is my way and results ….Yipee!

I guess i will get better when i learn more about optimizing my Python codes, Hey! at least it works.

Toolbox: Anaconda (Python) & Jupyter Notebook

Tags: , , ,