0

Help

Permit the user the initials of two people then print if they are compatible or not (they are compatible if both are liked) the table is like this              dani juan cata pipe dani 0 1 0 0 juan 1 0 1 0 cata 0 1 0 1 pipe 1 0 0 0   Example: cata and juan are compatible This is the table porfa help me is urgent thank you very much

10th May 2019, 11:11 PM
sergio
sergio - avatar
4 Answers
+ 2
in python I guess (since thats the only language you have looked at yet): tabel = { 'dani': { 'dani': 0, 'juan': 1, 'cata': 0, 'pipe': 0 }, 'juan': { 'dani': 1, 'juan': 0, 'cata': 1, 'pipe': 0 }, 'cata': { 'dani': 0, 'juan': 1, 'cata': 0, 'pipe': 1 }, 'pipe': { 'dani': 1, 'juan': 0, 'cata': 0, 'pipe': 0 } } person1 = input('person1: ') person2 = input('person2: ') print(person1 + ' and ' + person2 + 'compatable: ') print(str(tabel[person1][person2] == 1 and tabel[person2][person1] == 1))
10th May 2019, 11:31 PM
Anton Böhler
Anton Böhler - avatar
+ 1
Tanks you Gracias
11th May 2019, 11:54 AM
sergio
sergio - avatar
+ 1
Gracias me sirvio mucho
24th May 2019, 10:21 AM
sergio
sergio - avatar