如何将参数传递给link.typolink进行标记?

时间:2019-01-06 23:05:12

标签: fluid

我想传递给link.typolink一个参数,使链接可以被不同地标记!我需要使用哪个视图助手来输出参数?

import random
from random import randint

def b():
    b.num+=1
b.num=0

def s():
    s.num+=1
s.num=0

d=int(input("try count: "))

def a():
    winner=randint(1,3)
    selection=randint(1,3)
    doors=[1,2,3]
    doors_to_open=randint(1,2)
    if selection == 1:
        if doors_to_open==1:
            doors.remove(2)
        else:
            doors.remove(3)

    if selection == 2:
        if doors_to_open==1:
            doors.remove(1)
        else:
            doors.remove(3)

    if selection == 3:
        if doors_to_open==1:
            doors.remove(1)
        else:
            doors.remove(2)

    if selection == winner:
        b()
        #print("Not switching win count: ",b.num)

    # switch

    doors.remove(selection)
    selection = doors[0]

    if selection != winner: #Change is done in this line
        s()
        #print("Switching win count: ",s.num)

for q in range (0,d):
    a()

#print("Switching win count: ",s.num)
print("Switching percent: ",(s.num/d)*100)
#print("Not switching win count: ",b.num)
print("Not switching percent: ",(b.num/d)*100)

因此,我使用了if条件。但是如何最好地传递价值

1 个答案:

答案 0 :(得分:0)

<f:link.typolink class="info-btn info-btn--{theme}" parameter="{link}" >{label}</f:link.typolink>

我通常设置参数。我的问题是清空缓存