![]() |
VOOZH | about |
Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.
I help Businesses scale with AI x SEO x (authentic) Content that revives traffic and keeps leads flowing | 3,000,000+ Average monthly readers on Medium | Sr Technical Writer(Team Lead) @ DigitalOcean | Ex-Cloud Consultant @ AMEX | Ex-Site Reliability Engineer(DevOps)@Nutanix
Java and Python Developer for 20+ years, Open Source Enthusiast, Founder of https://www.askpython.com/, https://www.linuxfordevices.com/, and JournalDev.com (acquired by DigitalOcean). Passionate about writing technical articles and sharing knowledge with others. Love Java, Python, Unix and related technologies. Follow my X @PankajWebDev
Building future-ready infrastructure with Linux, Cloud, and DevOps. Full Stack Developer & System Administrator. Technical Writer @ DigitalOcean | GitHub Contributor | Passionate about Docker, PostgreSQL, and Open Source | Exploring NLP & AI-TensorFlow | Nailed over 50+ deployments across production environments.
the code for dictionary data type is wrong โฆas the key is always surrounded by double quotes โkeyโ correct code:- a = {โ1โ:โfirst nameโ,โ2โ:โlast nameโ, โageโ:33} #print value having key=1 print(a[โ1โ]) #print value having key=2 print(a[โ2โ]) #print value having key=โageโ print(a[โageโ])
- Shubham
@Shubham, This is not necessary. Double are required compulsory for text/strings whether you use them as Key or Value. Whenever you are using numeric as key or value, it is not mandatory that you have to use double quotes but if you are using string then you have to use it. For ex.: Case 1 : Numeric as Key without quotes and String as value a={1:โOneโ,2:โTwoโ,โAgeโ:35} >>> a[1] โOneโ Case 2: Numeric as Key in quotes and String as value >>> a={โ1โ:โOneโ,2:โTwoโ,โAgeโ:35} >>> a[โ1โ] โOneโ Case 3: String as Key and Numeric as value >>> a={โOneโ:1,2:โTwoโ,โAgeโ:35} >>> a[โOneโ] 1 Hope it is clear. Thanks
- Nidhesh Tiwari
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.