General idea:
First chosen number is the prefered and last one the least preferred
I would like to have the final result giving those result :
UPDATE 1:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery UI Effects - Animate demo</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">
<style>
.toggler { width: 500px; height: 200px; position: relative; }
#button { padding: .5em 1em; text-decoration: none; }
#effect { width: 240px; height: 170px; padding: 0.4em; position: relative; background: #fff; }
#effect h3 { margin: 0; padding: 0.4em; text-align: center; }
</style>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
$( function() {
var state = true;
$( "#button" ).on( "click", function() {
if ( state ) {
$( "#effect" ).animate({
backgroundColor: "#aa0000",
color: "#fff",
width: 500
}, 1000 );
} else {
$( "#effect" ).animate({
backgroundColor: "#fff",
color: "#000",
width: 240
}, 1000 );
}
state = !state;
});
} );
</script>
</head>
<body>
<div class="toggler">
<div id="effect" class="ui-widget-content ui-corner-all">
<h3 class="ui-widget-header ui-corner-all">Animate</h3>
<p>
Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.
</p>
</div>
</div>
<button id="button" class="ui-state-default ui-corner-all">Toggle Effect</button>
</body>
</html>
Traceback (most recent call last): line 30, in if tracking[week_pool] < 3: TypeError: unhashable type: 'list'
UPDATE THAT WORK !
@override
public void onAttach(Context context) {
super.onAttach(context);
context1=this.getActivity();
}
答案 0 :(得分:0)
<强>修订强>
from collections import OrderedDict
# Translate employe ids
ids_names = {
("01", "Jean"),
("02", "Claude"),
("03", "Van"),
("04", "Damme"),
("05", "Kristopher"),
("06", "Bianca"),
}
week_pool = list(range(1, 53))
employee_choices = OrderedDict([
("01", [1,2,3,4,5]),
("02", [1,2,3,4,5]),
("03", [1,2,3,4,5]),
("04", [1,2,3,4,5]),
("05", [2,3,4,5,6]),
("06", [1,2,3]),
])
说明
08-31:你有个好的开始。我会在这里更新说明并给你提示。一些小调:
range()
是获取整数范围的较短方法,但您的方法也有效。OrderedDict
是一个很好的电话。您可以使用它来订购资历。您只需要确保您的周数在一个单独的容器中,例如一个列表。我稍后添加了一些额外的名字。<强>目标强>