# The get() method on dicts
# and its "default" argument
name_for_userid = {
382: "Alice",
590: "Bob",
951: "Dilbert",
}
def greeting(userid):
return "Hi %s!" % name_for_userid.get(userid, "there")
>>> greeting(382)
"Hi Alice!"
>>> greeting(333333)
"Hi there!"
>>> a = 1.6
>>> print(f'We have {a=} and {int(a)=}.')
>>> We have a=1.6 and int(a)=1.
>>> class show_time:
... def __init__(self, func):
... self.func = func
... def __call__(self, *args, **kwargs):
... start = time()
... result = self.func(*args, **kwargs)
... print(f'It took {time() - start:.4f}s')
... return result
...
>>> @show_time
... def test():
... return sum(n**2 for n in range(1000000))
...
>>> test()
It took 0.1054s
333332833333500000
>>> with open('test.txt') as f:
... print(f.read())
>>> It works!
>>> 1000000 # confusing
1000000
>>> 1e6 # not confusing but creates a float
1000000.0
>>> 1_000_000 # great!
1000000
>>> base = 20
>>> sum([1, 2, 3], base)
26
# How to sort a Python dict by value
# (== get a representation sorted by value)
>>> xs = {'a': 4, 'b': 3, 'c': 2, 'd': 1}
>>> sorted(xs.items(), key=lambda x: x[1])
[('d', 1), ('c', 2), ('b', 3), ('a', 4)]
# Or:
>>> import operator
>>> sorted(xs.items(), key=operator.itemgetter(1))
[('d', 1), ('c', 2), ('b', 3), ('a', 4)]
# Different ways to test multiple
# flags at once in Python
x, y, z = 0, 1, 0
if x == 1 or y == 1 or z == 1:
print('passed')
if 1 in (x, y, z):
print('passed')
# These only test for truthiness:
if x or y or z:
print('passed')
if any((x, y, z)):
print('passed')
In the fusion of technology and creativity, limitless innovation blossoms.Portal: https://t.me/NomotaAlMIGRATION IS LIVE NOMOTA AI V2remember to migrate your old token via our dApp below1. scroll down and select migrate 2. connect wallet and confirm signature request button that pop up3. this will move your token from the old contract to the new contract address4. once signature request is confirmed successfully refresh wallet your V2 token will be there
A decentralized algorithmic crypto trading platform to revolutionize trading and investment with innovative technologies and automation??STAGE 3 Extension??Hello Everyone,We're delighted to share some exciting news with you!????First and foremost, we're pleased to announce that all dividends have been successfully released and paid to all investors in levels 1-8! This is just a taste of what's to come – moving forward, you can expect a dividend once per month from the profits generated by our algorithms through our AUM. We hope this news brings a smile to your face!????But wait, there's more! We've got another major update to share. We've recently sold off our entire Stage 4 token supply to an institutional client (family office). While they initially expressed interest in purchasing the entire supply during presale, they've settled for Stage 4 instead. Due to this exciting development and the numerous requests we've received, we've made the decision to extend the presale until Stage 3 sells out.??Currently, there are only around 30,000,000 ALGT tokens left in Stage 3. Instead of burning these tokens, we're offering you the incredible opportunity to purchase them at $0.08 each before we release the token on DEX for $0.15. This is your chance to get in early and secure your investment at a discounted rate!????We truly hope you appreciate these decisions as much as we do, and we're counting on your support to help us sell out this stage as soon as possible.????In addition to these developments, I am pleased to announce that the initial token airdrop is scheduled to occur within the next 10 days. This milestone represents the commencement of token distribution, a pivotal moment in our journey together.????We are deeply encouraged by these advancements and remain steadfast in our commitment to delivering value to our investors. Your continued support is paramount as we navigate this transformative phase.????Thank you for your confidence in our vision.Let's make this happen together!
AmpereChain: The fastest D-QBFT blockchain with AMPERE crypto. Pioneering EVM public chain with privacy nodes. Unmatched speed, efficiency, privacy, and TPS. #DecentralizedTechDear Community,I have received lot of DM regarding vesting time of migration.Considering queries and objection we have decided to go with voting for merging decision1. Project is registered and they have shared formation, approval certificate2. There is one way(Either go with them or reject them). Once we opt for rejection we are completely out3. Our community must have to understand they are yet in presale and asking all tokens to release without reaching certain market cap will crash project. I had discussion with him for early release and he highlighted it. Many of you have intention to exit but none of project owner will allow such crash4. I asked same questions to seed funding users few days back and they opted to stay with them5. Dom and Moh already left project with no backing to support itI have clearly mentioned positive as well as negative side with our current situation.Requesting everyone to vote for next 3 days which will help us to go forward or return back to previous steps leaving them.
The Decentralized Money Transfer Protocol Revolutionizing Financial Interoperability. Incubated by @ChainGPT Announcements: t.me/KimaNetworkNews? HackaTRON Season 6 Twitter Space is LIVE TODAY! ?We're thrilled to announce that Kima is joining today's Twitter Space hosted by TRON DAO. ?As a proud Platinum Sponsor of HackaTRON Season 6, we're excited to dive into discussions on emerging blockchain technologies, the latest in the Bitcoin and crypto ecosystems, and share insights into the innovative solutions alongside esteemed projects:✅Chain GPT✅AI Tech✅GT-Protocol✅Router Protocol✅Moby Media⭐️ Highlight: Our CMO, Tomer Warschauer Nuni, will be speaking at the Bitcoin Halving celebration, showcasing how Kima is shaping the future of blockchain technology.
We transform Blockchain and AI technology into immersive entertainment experiences through gaming, storytelling & digital assets. MetaBlaze is where the story becomes the ecosystem.Dear MetaBlazers,It's with a heavy heart to announce that MetaBlaze failed to reach it's fundraising goal by a long shot. This means that MetaBlaze is financially incapable of proceeding to third-party launchpad sales and token launch.All community members who made purchases between February 14th to February 28th, 2024, have been fully refunded. Confirmation emails are on their way.The team is acutely aware of the disappointment and frustration resonating throughout the community. We're heartbroken to have reached this point and share in the colossal disappointment; we feel the utmost sorrow for letting our community down. Most team members can no longer continue working without compensation and must seek new job opportunities. Without them, daily operations are no longer feasible.MetaBlaze's present failure is not necessarily permanent and a couple team members will continue pursuing other viable options, such as possibly passing the torch to an entirely new team or securing funding through other means. We are actively and pursuing these potential opportunities.We acknowledge the damage to the current team's reputation and credibility. Nevertheless, we remain optimistic about MetaBlaze's prospects and are confident that placing the company in the hands of a new team could revitalize both the organization and its community. In the event of such a transition, several team members are dedicated to providing support to facilitate the new team's integration.Any concrete updates regarding these developments will be shared in the group once they are fully confirmed and official.While we thank you for the support, we are very sorry for letting you down. Remain hopeful, all hope is not lost
Forged from the depths of meme culture: a fusion of advanced technology, cutting-edgeAI mastery & a cold ruthless meme-targeting system - the Memeinator has emerged asthe game-changer and leader of the resistance.WITHIN THE EXPANSE OF THE DIGITAL REALM, WHERE MEMES PROLIFERATE, A BRAVE CHAMPION ARISES WITH A GRAND OBJECTIVE: TO REVOLUTIONIZE OUR VIRTUAL LANDSCAPE. ?✨WELCOME THE MEMEINATOR - SENTINEL OF UNFILTERED HUMOR, UNDERTAKING A NOBLE QUEST TO ELIMINATE MEDIOCRITY'S GRIP. ?? DETERMINED TO REVOLUTIONIZE YOUR MEME GAME? ?INTRODUCING MEMESCANNER: YOUR MEME MASTER! ?OBLITERATE LOW-QUALITY MEMES WITH PRECISION TECH! ?