samedi 13 juin 2020

Randomly select a pair of elements from a two dimensional array and place them in a sentence in python

''' import random

quizwords = [["hot", "cold"],["summer","winter"],["hard","soft"],["dry","wet"],["simple","complex"],["light","darkness"],["weak","strong"],["male","female"],["sad","happy"],["win","lose"],["small","big"],["ignore","pay attention"],["sell","buy"],["succeed","fail"],["reject","accept"],["prevent","allow"],["exclude","include"]]

c = 0 random.shuffle(quizwords) for i in quizwords: print(i[0][0],"is to",i[0][1],"as",i[1][0],"is to...") ans = input() '''

This is my code so far and I believe it would for example output 'e is to c as s is to...' im trying to have it instead say 'exclude is to include as reject is to...(answer: accept)'




Aucun commentaire:

Enregistrer un commentaire