Fun with Python - Solving Project Euler Problem 1

preview_player
Показать описание
In this video, we'll solve Problem 1 from Project Euler. I'll show you two solutions using a for loop and a while loop.

0:00 Introduction
0:40 Disclaimer: not an expert programmer!
1:29 Resources
1:56 Windows Subsystem for Linux (WSL)
2:23 Python interpreter
2:56 Project Euler
5:55 Problem 1
6:35 Programming logic to solve the problem
7:27 How to test if a number is a multiple of 3 or 5
9:13 if statement
10:12 for loop
11:17 Add number to the sum
13:06 Demonstrating the += assignment operator
14:49 Putting the code together
16:19 Boolean logic (True or False)
17:37 Running the code on WSL
19:25 Alternative solution: while loop
20:20 Explaining the code for alternative solution
21:47 Logic problem with while loop
22:25 Indentation is important!
22:59 Experimenting with indentation
25:35 Fixing the code
26:42 Ending

Thank you for watching!

LIKE 👍🏼 and SUBSCRIBE ❤️

Рекомендации по теме
Комментарии
Автор

Hello and thanks for the video, this problem is solve in O(1): with no iterations

gonzalorodriguez
welcome to shbcf.ru