Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tut] How to Create Your Own Search Engine in a Single Line of Python?

#1
How to Create Your Own Search Engine in a Single Line of Python?

This Python One-Liner is part of my Python One-Liners book with NoStarch Press.



Here’s the code from the video:

letters_amazon = '''
We spent several years building our own database engine,
Amazon Aurora, a fully-managed MySQL and PostgreSQL-compatible
service with the same or better durability and availability as
the commercial engines, but at one-tenth of the cost. We were
not surprised when this worked. ''' find = lambda x, q: x[x.find(q)-18:x.find(q)+18] if q in x else -1 print(find(letters_amazon, 'SQL'))

Try It Yourself:

Related Articles:



https://www.sickgaming.net/blog/2020/04/...of-python/
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tut] Python’s NameError: name ‘xxx’ is not defined — How to Fix This Stupid Bug? xSicKxBot 0 8 10-16-2020, 10:30 PM
Last Post: xSicKxBot
  [Tut] Python IndentationError: unexpected indent (How to Fix This Stupid Bug) xSicKxBot 0 17 10-10-2020, 08:24 PM
Last Post: xSicKxBot
  [Tut] Yield Keyword in Python – A Simple Illustrated Guide xSicKxBot 0 18 10-09-2020, 06:13 PM
Last Post: xSicKxBot
  [Tut] Python Reverse List with Slicing — An Illustrated Guide xSicKxBot 0 29 10-02-2020, 04:24 AM
Last Post: xSicKxBot
  [Tut] How to Remove Duplicates From a Python List While Preserving Order? xSicKxBot 0 30 10-01-2020, 02:21 AM
Last Post: xSicKxBot
  [Tut] How To Update A Key In A Dictionary In Python If The Key Doesn’t Exist? xSicKxBot 0 32 09-29-2020, 09:02 PM
Last Post: xSicKxBot
  [Tut] How to Get the Last Element of a Python List? xSicKxBot 0 34 09-28-2020, 02:36 AM
Last Post: xSicKxBot
  [Tut] How To Format A String That Contains Curly Braces In Python? xSicKxBot 0 31 09-25-2020, 07:51 PM
Last Post: xSicKxBot
  [Tut] Python One Line Dictionary xSicKxBot 0 38 09-21-2020, 05:58 PM
Last Post: xSicKxBot
  [Tut] Python Import Error (ModuleNotFoundError) xSicKxBot 0 33 09-20-2020, 04:15 PM
Last Post: xSicKxBot

Forum Jump:

Become a Patron!
[-]
Upcoming Events

[-]
Latest Threads
[Tut] Top 3 Freelance Developer Contract...
Last Post: xSicKxBot
Today 04:49 AM
» Replies: 0
» Views: 0
(Indie Deal) Alien Cat Bundle, RIDE 4 re...
Last Post: xSicKxBot
Today 04:48 AM
» Replies: 0
» Views: 1
News - Super Smash Bros. Ultimate 9.0.1...
Last Post: xSicKxBot
Today 04:48 AM
» Replies: 0
» Views: 1
Unity Mega Bundle X 10th Anniversary Sal...
Last Post: xSicKxBot
Today 01:02 AM
» Replies: 0
» Views: 3
Microsoft - Fundraising and Engagement f...
Last Post: xSicKxBot
Today 01:02 AM
» Replies: 0
» Views: 2
Fedora - Incremental backup with Butterf...
Last Post: xSicKxBot
Today 01:01 AM
» Replies: 0
» Views: 2
News - Review: Horace – A Heart-Warming ...
Last Post: xSicKxBot
Yesterday 11:38 PM
» Replies: 0
» Views: 2
News - Matthew McConaughey Explains The ...
Last Post: xSicKxBot
Yesterday 10:20 PM
» Replies: 0
» Views: 3
PlanetSide 2 External Hack / Mod
Last Post: FarCry10
Yesterday 05:27 PM
» Replies: 6
» Views: 6812
(Indie Deal) FREE Defense of Roman Brita...
Last Post: xSicKxBot
Yesterday 03:53 PM
» Replies: 0
» Views: 4

[-]
Twitter

[-]
Sponsored
Get the Deal of the Week at RefurBees.com

Copyright © SickGaming.net 2012-2020