Phyton if question | Sololearn: Learn to code for FREE!

+1

Phyton if question

import random A= [ "Kevin","Milan","Lucas","Roma","federico"] print (random.choice(A)) Gay = ['gay','cool','raar','lelijk','bol'] print (random.choice(Gay)) if 'federico' == "bol": print ('klopt') I have this. But the last part doesn't work. how can I fix this?

2/17/2022 8:43:08 PM

Robin hamerslag

5 Answers

New Answer

+1

Thank you

0

if 'federico' == "bol": how thes two are equal? Never. What are trying by this?

0

Its my first time so i dont really get it i just want to if the name is federico that (klopt( is says in the text

0

import random A= [ "Kevin","Milan","Lucas","Roma","federico"] name = random.choice(A) #strore into a variable print(name) Gay = ['gay','cool','raar','lelijk','bol'] x = random.choice(Gay) #store into varisble print(x) if name == 'federico' or x=="bol": #using here print('any one true','klopt',1) if name == 'federico' and x=="bol": print('both true','klopt',2) if name == 'federico': print ('klopt',3) if x=="bol": print ('klopt',4) print("finished")

0

You can do something like this. Nice little concept tho lol. https://code.sololearn.com/cxQ0WIXy3NmN/?ref=app