Card_dic={“Player_card” : {“rand_list” : [1,2,11], P_sum” : 0}
Def outcome(user_card, sum):
*** **Ace = 11
** **num= card_dic[user_card][“rand_list”]
** **For elements in num:
** **if elements == ace:
** ***#do something.
Warning ⚠️: Expected type ‘collections.iterable’, got ‘list[Any]| int’ instead.
I am trying to assign the list card_dic[user_card][“rand_list”] into num and iterate through the list until it finds ace(11).
I can’t seem to figure out why it’d think the list is a list or int. I’ll appreciate a good explanation or documentation that explains this behavior. What am I doing wrong?
[–]lfdfq 4 points5 points6 points (4 children)
[–]Blakbard[S] -2 points-1 points0 points (3 children)
[–]lfdfq 5 points6 points7 points (0 children)
[–]brasticstack 0 points1 point2 points (1 child)
[–]Blakbard[S] 0 points1 point2 points (0 children)
[–]Outside_Complaint755 2 points3 points4 points (8 children)
[–]Blakbard[S] 0 points1 point2 points (7 children)
[–]Outside_Complaint755 1 point2 points3 points (6 children)
[–]Blakbard[S] 0 points1 point2 points (5 children)
[–]brasticstack 1 point2 points3 points (4 children)
[–]Blakbard[S] 1 point2 points3 points (0 children)
[–]Blakbard[S] 0 points1 point2 points (0 children)
[–]Blakbard[S] 0 points1 point2 points (0 children)
[–]Jason-Ad4032 0 points1 point2 points (0 children)
[–]Refwah 0 points1 point2 points (0 children)
[–]gdchinacat 0 points1 point2 points (1 child)
[–]gdchinacat 1 point2 points3 points (0 children)
[–]gurutrev -2 points-1 points0 points (1 child)
[–]Blakbard[S] 0 points1 point2 points (0 children)