Guru's Verification engine ensures consistency, confidence, and trust in the knowledge your organization shares. Learn more.

Julia | Check if Dictionary Has Key

Use the haskey function:

d = Dict(1 => 10)Dict{Int64,Int64} with 1 entry:  1 => 10haskey(d, 1) #truejulia> haskey(d, 2) #false# source: https://discourse.julialang.org/t/tell-if-a-key-is-present-in-a-dict/39587/2

Resources:

You must have Author or Collection Owner permission to create Guru Cards. Contact your team's Guru admins to use this template.