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.
Create a string with alternate true false sentences
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.
start = """You cannot change the values of a tuple in Python
You can change the values of a tuple in Python
To add a value to a list you can use append in Python
To add a value to a list you can use push in Python
Indentation must be essential in Python
Indentation is no essential in Python
""".split("\n\n")
The start variable will point at this list
[‘You cannot change the values of a tuple in Python\nYou cann change the values of a tuple in Python’, ‘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’, ‘Indentation must be essential in Python\nIndentation is no essential in Python\n’]
To make every test different we must import choice from the built-in random module
from random import choice
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.
vf = []
for n in tutte:
vf.append(f"{tutte.index(n)+1} {choice(n)}")
Now we can have our output:
print(*vf, sep=" [V] [F]\n", end= " [V] [F]\n")
Output:
1 You can change the values of a tuple in Python [V] [F] 2 To add a value to a list you can use push in Python [V] [F] 3 Indentation is not essential in Python [V] [F]
If we run again the code the result will be different.