{"id":1718,"date":"2019-03-08T12:49:22","date_gmt":"2019-03-08T11:49:22","guid":{"rendered":"https:\/\/pythonprogramming.altervista.org\/?p=1718"},"modified":"2019-03-08T12:51:53","modified_gmt":"2019-03-08T11:51:53","slug":"python-teach-different-true-false-for-every-student","status":"publish","type":"post","link":"https:\/\/pythonprogramming.altervista.org\/python-teach-different-true-false-for-every-student\/","title":{"rendered":"Python teach: different true false for every student"},"content":{"rendered":"<p>If you wanto to make a true false test for your students, it could be a good habit to shake the propositions so that it would be difficult to look at the others test to copy the answers. There are many way to do it, I suggest this one.<\/p>\n<h2>Create a string with alternate true false sentences<\/h2>\n<p>I suggest to make two versions of the same sentence, a true one and a false one, then an empty line and so on. This makes easier to write your sentences, with a multiline string.<\/p>\n<pre class=\"lang:python decode:true\" title=\"True false shuffler\">start = \"\"\"You cannot change the values of a tuple in Python\r\nYou can change the values of a tuple in Python\r\n\r\nTo add a value to a list you can use append in Python\r\nTo add a value to a list you can use push in Python\r\n\r\nIndentation must be essential in Python\r\nIndentation is no essential in Python\r\n\"\"\".split(\"\\n\\n\")<\/pre>\n<p>The start variable will point at this list<\/p>\n<p><span class=\"lang:default decode:true crayon-inline\">[&#8216;You cannot change the values of a tuple in Python\\nYou cann change the values of a tuple in Python&#8217;, &#8216;To add a value to a list you can use append in Python\\nTo add a value to a list you can use push in Python&#8217;, &#8216;Indentation must be essential in Python\\nIndentation is no essential in Python\\n&#8217;]<\/span><\/p>\n<p>To make every test different we must import choice from the built-in random module<\/p>\n<pre class=\"lang:default decode:true \">from random import choice<\/pre>\n<p>Now we can create a list with just one sentence (randomly true or false), splitting every string of the previous list by the \\n newline character.<\/p>\n<pre class=\"lang:default decode:true \">vf = []\r\nfor n in tutte:\r\n    vf.append(f\"{tutte.index(n)+1} {choice(n)}\")<\/pre>\n<p>Now we can have our output:<\/p>\n<pre class=\"lang:default decode:true \">print(*vf, sep=\" [V] [F]\\n\", end= \" [V] [F]\\n\")<\/pre>\n<p>Output:<\/p>\n<pre class=\"lang:default decode:true\">1 You can change the values of a tuple in Python [V] [F]\r\n2 To add a value to a list you can use push in Python [V] [F]\r\n3 Indentation is not essential in Python [V] [F]<\/pre>\n<p>If we run again the code the result will be different.<\/p>\n","protected":false},"excerpt":{"rendered":"A way to shuffle true false sentences in a trickier way.\n<a class=\"moretag\" href=\"https:\/\/pythonprogramming.altervista.org\/python-teach-different-true-false-for-every-student\/\"> [...]<\/a>","protected":false},"author":1,"featured_media":689,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[338,333,275],"tags":[],"class_list":["post-1718","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python-to-teach","category-test","category-test-maker"],"avopt_banners_inside_post":true,"avopt_banners_on_page":true,"av_copy_from":"","av_sharing_message":"","av_sharing_allowed":false,"av_sharing_on":{"fb":[],"tw":[]},"av_allow_affiliate_banner":false,"av_allow_affiliate_multi_banner":false,"av_show_affiliation_buy_button":false,"av_post_rating":true,"av_have_post_rating_value":false,"av_is_artificial_intelligence_content":false,"_links":{"self":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/1718","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/comments?post=1718"}],"version-history":[{"count":4,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/1718\/revisions"}],"predecessor-version":[{"id":1723,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/1718\/revisions\/1723"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/media\/689"}],"wp:attachment":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/media?parent=1718"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/categories?post=1718"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/tags?post=1718"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}