Issue
def doh(a, b, c):
if a[str(b)] + c == a[c + 'x']:
print(b + 2)
expect output:
11
Where do I start to approach? And what are these variables type?
Solution
Solution
Pass these values for variable a,b,c
variable a must be a dictionary, variable b should be integer 9 and variable c should be a string or alphabet
#function defenition
def doh(a, b, c):
if a[str(b)] + c == a[c + 'x']:
print(b + 2)
a = {'9':'d','cx':'dc'}
b=9
c='c'
doh(a, b, c)
Result
11
Another Solution
a = {'9':'michael','hix':'michaelhi'}
b=9
c='hi'
doh(a, b, c)
So the relation should be like in the following figure.
I hope this would be helpful
Answered By - Littin Rajan Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.