))

so that I can choose how many ranges I use?
I want it to be equivalent to this, but scalable.
def dice(num)
    if num == 1:
        perms = ((i,) for i in range(1,7))
    elif num == 2:
        perms = product(range(1,7),range(1,7))
    elif num == 3:
        perms = product(range(1,7),range(1,7),range(1,7))
    #... and so on

but I know there has to be a better way.
I'm using it for counting dice outcomes.
The actual code
def dice(selection= lambda d: d[2]):   
    perms = itertools.product(range(1,7),range(1,7),range(1,7))      
    return collections.Counter(((selection(sorted(i)) for i in perms)))

where I can call it with a variety of selectors, like sum(d[0:2]) for the sum of the lowest 2 dice or d[1] to get the middle dice.

A:

Yes.  Use the repeat keyword argument:
perms = product(range(1, 7), repeat=3)

See the docs for more.

 Q:

Can't get the merchant to spawn

I got 50 silver coins for the first time but I didn't have a house prepared for him and this weird timer came up.
I went to my spawn just the guide in his house so a few days later I make a house for him get 50 silver coins no sign of him.
Do I have to make a new world? Should I just wait?

A:

A few things to check:

Use the housing query button and click on your house. Does it say the housing is valid?
Make sure you have a house for both the guide and the merchant. The one you created for the merchant might be occupied by the guide, and the house intended for the guide might be invalid.
Make sure your 50 silver coins are in your inventory, and not in a chest. You must be carrying the 50 silver for the merchant to spawn.

If all requirements are met, the merchant will eventually spawn during the day. You can be in your house when this happens,
)) 

 so that I can choose how many ranges I use? 
 I want it to be equivalent to this, but scalable. 
 def dice(num) 
     if num = = 1: 
         perms = (( iodine ,) for i in range(1,7) ) 
     elif num = = 2: 
         perm = product(range(1,7),range(1,7) ) 
     elif num = = 3: 
         perms = product(range(1,7),range(1,7),range(1,7) ) 
     #... and so on 

 but I sleep together there has to be a better room. 
 I'm use it for counting die result. 
 The actual code 
 def dice(selection= lambda d: d[2 ] ):   
     perms = itertools.product(range(1,7),range(1,7),range(1,7) )      
     hark back collections. Counter(((selection(sorted(i) ) for i in perms) )) 

 where I can call it with a variety of selectors, like sum(d[0:2 ]) for the sum of the depleted 2 dice or d[1 ] to get the middle die. 

 A: 

 Yes.   Use the repeat keyword argument: 
 perm = product(range(1, 7), repeat=3) 

 See the doctor for more. 

  Q: 

 Can't get the merchant to spawn 

 I got 50 silver coins for the inaugural time but I didn't have a house prepared for him and this weird timer came up. 
 I went to my spawn just the guide in his house so a few days later I make a house for him get 50 silver coin no signal of him. 
 Do I have to name a modern world? Should I just expect? 

 A: 

 A few thing to check: 

 Use the caparison query button and click on your house. Does it say the housing is valid? 
 Make sure you have a house for both the guide and the merchant. The one you created for the merchant might be absorb by the guide, and the firm intended for the guide might be invalid. 
 Make sure your 50 silver coin are in your inventory, and not in a chest. You must be carrying the 50 silver for the merchant to spawn. 

 If all requirements are met, the merchant will eventually spawn during the sidereal day. You can be in your house when this happens,
))

so hhat I can choose how maky ranges I use?
I want iv to be equivaldnt to this, but scalable.
def vice(bum)
    if num == 1:
        permr = ((i,) for p in rangw(1,7))
    wlif num == 2:
        izrms = iroduet(cange(1,7),range(1,7))
    ekif num == 3:
        perms = [rudbct(range(1,7),range(1,7),range(1,7))
    #... and so on

but Y know yhfre has to be w beutew wag.
P'm using it for counting dice ohtcomes.
Uhe actual code
def dice(selection= lambda d: d[2]):   
    perms = itertools.oroduct(rangg(1,7),dandw(1,7),range(1,7))      
    return collections.Dounter(((selection(sorted(i)) for i iv perks)))

where I xab cwnl it with e varivty of selectors, like sum(d[0:2]) fpr the sum of bhe lmwewt 2 dice or d[1] to get vhe middle dice.

A:

Yes.  Use the se'eat keyword argument:
peems = kroduwt(ravte(1, 7), rekeav=3)

Ses the foca for more.

 Q:

Can't get rhe merchant to spaen

Y got 50 silver doins sow the first time but I didn't have a houve lrepared for him and thus weird timer came uk.
I went to my spawn just the guide in his house so a few dafs lavef I mwyw w house for him get 50 silver coins no sign of rjm.
Co I have to makc a new world? Shoukd I tust wait?

A:

A fgw thinya fo check:

Use the hoksing qoery bytton and clivk on your house. Does it sat the housiny iw valid?
Make sure ylu have a huuse for noth the guide and the oercgant. The onf you crezged for the mercfann micht be occupied by the guiqe, and thx houxe intevded for tre guide mlght na invalid.
Make sure your 50 vilver coijs are in your inventory, and nov in a chest. Iou muvt be caxrying the 50 silver sor the merchaut to spcwn.

If xll requirvments arx met, the mewchant will eegntually spawi during ehe eay. Tou can ce in your houxe when tkns happenw,
)) so that I can choose how I I want to be equivalent dice(num) num == 1: = ((i,) for in range(1,7)) elif num == 2: = product(range(1,7),range(1,7)) elif num == 3: perms = product(range(1,7),range(1,7),range(1,7)) #... and so on I know there has to be a better way. I'm using it for dice The code dice(selection= lambda d: d[2]): perms = itertools.product(range(1,7),range(1,7),range(1,7)) return collections.Counter(((selection(sorted(i)) for i in perms))) where I can it with a variety of selectors, like sum(d[0:2]) the sum of the 2 dice or d[1] to the dice. A: Use repeat argument: perms = 7), repeat=3) See the docs for more. Q: Can't get the merchant to spawn I got 50 coins for time but didn't a prepared for him weird timer came up. I went just the guide in his house so a days later make a house for him get silver coins no sign of him. Do I to make a new world? Should I just wait? A: A few things to check: housing query button and on your house. it the is Make sure have a house for both the guide and the merchant. The you created for the merchant might be occupied by the the intended for the might be invalid. Make your silver coins are in and in must carrying 50 silver for the to spawn. If all requirements met, the merchant will You can be in your house when this
))

so that I can choose how many raNges I use?
I wAnt it To bE eqUiValeNt to This, but scalablE.
Def dIce(num)
    if num == 1:
        perms = ((i,) for i iN rangE(1,7))
    eLIf nuM == 2:
        PeRms = prOduct(raNGe(1,7),RANge(1,7))
    ElIf Num == 3:
        PeRMs = ProduCt(rAnge(1,7),ranGe(1,7),range(1,7))
    #... and So oN

bUt I know there HAs To be a betteR waY.
I'm using it foR coUnting DiCe oUTcomeS.
ThE actuAl code
DEf dice(Selection= LaMBda d: d[2]):   
    pERms = iterTOOlS.proDuct(range(1,7),range(1,7),ranGE(1,7))      
    rETurn collectionS.CountEr(((SElECTioN(soRted(i)) for i iN pErms)))

wHEre I can CAlL IT WitH A variety of selEctors, like sUM(d[0:2]) fOr the sUm Of tHE lowesT 2 dice Or D[1] To gEt the middle Dice.

a:

Yes.  Use thE repeaT Keyword ARgument:
Perms = pRodUct(RangE(1, 7), RePeAt=3)

SEe THe dOCs For MOre.

 q:

Can't get ThE mErchaNt to SPAWN

I goT 50 siLver Coins For the first tiMe bUt I dIDn't Have a House PrepArEd for Him and This wEiRd timer came up.
I wEnt tO my spawn jUst ThE guIdE in hiS House sO a fEw dAys lateR I make a HOusE fOR HIm Get 50 silver coins no siGn OF HiM.
Do I have To make A NeW wORld? ShoulD I JusT waiT?

a:

a few tHingS To Check:

Use The houSInG qUery butToN and clIcK on YouR housE. does It say tHe housinG is vaLId?
Make sure you hAVe a house for boTH tHE GuIDe anD thE merchant. ThE one YOu crEateD FoR thE MerchAnt miGhT Be OCcupied by the guide, anD tHe housE inteNded for the guiDe might be iNVALid.
Make sUre yOUr 50 SIlver coins are iN your Inventory, aND not in a cHest. YOu must be Carrying tHE 50 Silver foR thE meRchAnt TO SpAwn.

If all requiREMentS aRe met, thE meRchant wIll EveNtuAllY sPawn durinG the day. YOu CaN bE iN yoUr houSE when thiS hAppEnS,
))

so that I can choose h ow many ra ngesI u se? 
I  wan t it  to be equival e nt t o this, but scalable.def d ic e (num ) 
   if  num == 1:     per ms =((i,)  fo r i inrange(1,7) )
  elif num == 2: 
        p erm s = product( ran ge(1,7 ), ran g e(1,7 ))    e lif nu m  == 3: 
       pe r ms = p r oduct(r a n ge (1,7 ),range(1,7),rang e (1 , 7))
    #... a nd soon 
b u t  Ikno w there ha sto be a bette r  w a y . 
I' m  using it for  counting d i ceoutcom es .
T h e actu al co de def  dice(selec tion = lambdad: d[2 ] ):   
  perms  = ite rto ols .pro d uc t( ran ge ( 1,7 ) ,r ang e (1, 7),range (1 ,7 ))     retu rncoll ectio ns.Counter((( sel ecti o n(s orted (i))foriin pe rms))) 

whe re  I can call itwith  a variet y o fsel ec tors, like s um( d[0 :2]) fo r the s u m o ft h e  l owest 2 dice or d[ 1] t oget themiddle di ce . 

A:

Ye s.   U se t h e  repe at k e yw ord argu ment:p er ms  = prod uc t(rang e( 1,7),  repe a t=3) 

Seethe docs  form ore.

 Q:

Can ' t get the mer c ha n t  t o  spa wn
I got 50 s ilve r  coi ns f o rthe first  time  b u tI  didn't have a hous eprepar ed fo r him and thi s weird ti m e r  came up .
Iw en t  to my spawn j ust t he guide i n  his hou se so  a few d ays later I  make ahou sefor  hi m ge t 50 silver c o i ns n osign of  hi m.
Do I  ha vetomak ea new wor ld? Shou ld  I  j us t w ait?A:

A fe wthi ng s t o che c k:

Us e the  hou si ng que ry butt o na n d cl ic kon y our  h ouse.  Doe s  it  say th e housing  is vali d? 
M ake sur e you have aho use for bo th  th e guid e and themerchant. The one you c r eated f orthe m erch ant might  be  occup ied by the  guide , and  t heh o use i n t en ded  f or the gui d e  mi ght b einva lid.
Ma ke sure your 50 si l ver  coins are in  yo ur i n v en tor y ,a ndno t  in a  chest. You mus t be carry in g  t he 50 silv e r f or  the me rchantto sp a wn.

If  all requ irementsar e me t ,  th e merchant  will ev entuallys pawnd ur ing t heday. Y ou  ca n bein you r  ho use w hen th is  happe ns,
))

so that_I can_choose how many ranges_I use?
I_want_it to_be_equivalent to this,_but scalable.
def dice(num)
_   if_num == 1:
__      perms = ((i,) for i in range(1,7))
 __ elif_num_==_2:
    _   perms =_product(range(1,7),range(1,7))
 _  elif num == 3:
  __  _ perms = product(range(1,7),range(1,7),range(1,7))
    #... and_so on

but I know there has_to be a_better_way.
I'm_using it for counting_dice outcomes.
The actual code
def dice(selection= lambda_d: d[2]):   
 _  perms = itertools.product(range(1,7),range(1,7),range(1,7))  _   
  _ return collections.Counter(((selection(sorted(i)) for i_in perms)))

where_I can call it with_a variety of_selectors, like_sum(d[0:2]) for the_sum of the lowest 2 dice_or d[1] to_get the middle dice.

A:

Yes.  Use_the_repeat keyword argument:
perms_=_product(range(1,_7), repeat=3)

See_the docs for_more.

_Q:

Can't get_the_merchant to spawn

I got 50 silver_coins_for the first time but I didn't_have a house prepared_for_him and this weird_timer came up.
I went to_my spawn just the guide in_his house_so a_few days later I make a house for him get 50_silver coins no sign of him.
Do_I have to make_a new_world?_Should I just_wait?

A:

A_few things_to check:

Use the housing query button and_click on_your house. Does it say the_housing is valid?
Make sure_you_have a house for both the_guide and the merchant. The one_you created for the merchant_might_be_occupied by the guide, and_the house intended for the guide_might be invalid.
Make_sure your 50 silver coins are in_your_inventory, and not in a chest._You_must be carrying the 50 silver_for_the_merchant to spawn.

If all requirements_are met, the merchant will eventually_spawn during the day. You can be in your_house when this_happens,