Ciao ragazzi e benvenuti in questo nuovo video, in questo breve tutorial vi spiego come realizzare Sasso Carta Forbice su Python.
Spero che il video vi piaccia, nel caso vi invito a lasciare un mi piace!
Codice vincita/perdita/pareggio:
if scelta_utente == 's' and opzioni_computer[scelta_computer] == 's':
print("Pareggio")
elif scelta_utente == 'c' and opzioni_computer[scelta_computer] == 'c':
print("Pareggio")
elif scelta_utente == 'f' and opzioni_computer[scelta_computer] == 'f':
print("Pareggio")
elif scelta_utente == 's' and opzioni_computer[scelta_computer] == 'c':
print("Hai perso")
elif scelta_utente == 's' and opzioni_computer[scelta_computer] == 'f':
print("Hai vinto")
elif scelta_utente == 'c' and opzioni_computer[scelta_computer] == 'f':
print("Hai perso")
elif scelta_utente == 'c' and opzioni_computer[scelta_computer] == 's':
print("Hai vinto")
elif scelta_utente == 'f' and opzioni_computer[scelta_computer] == 'c':
print("Hai vinto")
elif scelta_utente == 'f' and opzioni_computer[scelta_computer] == 's':
print("Hai perso")
Mi trovate anche su:
Instagram: / sebastianomora
Tik Tok: https://www.tiktok.com/@sebastiano.mo...
Twitter: / sebastianomora