Gen-AI Developer Classroom notes 23/Feb/2025

Project euler 9

  • Brute force: Check all the possibilities

General sites/books to research about python

  • First preference Real Python
  • I would suggest
    • Programiz
    • Geek for Geeks
    • W3schools
  • Books:
    • Think Python
    • Python in a nutshell
    • Head First Python
    • Learn Python

Python

  • Python is a dynamically typed language i.e. you need not specify types while writing code
  • Each line is a statement in python
  • Lets checkout REPL (Read evaluate Print loop) provided as part of python installation. Open terminal and type python
    Preview
  • Easier way to find types in python is using a special function type()
  • Zen of Python Refer Here
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

Project euler problem 1

result = 0
limit = 10
index = 1
until index < limit do the following
  if (index % 3 == 0) or (index % 5 == 0) then
        result = index + result
  end
  index = index + 1
end

By continuous learner

enthusiastic technology learner

Leave a Reply

Discover more from Direct AI Powered By Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading