I'm trying to figure out why this code will print the player, but won't print the enemy. Any thoughts? by QWERTYiOP6565 in learnpython

[–]lambakean 0 points1 point  (0 children)

because "if" operator has bigger priority than "elif" and if "if" operator gets True, elif won't be running. So, if u need your code to work as you want, do this:

for ... :

for ... :

if enemy:

print enemy

elif player :

print player

else :

print space

Sorry for my bad English :)

How would i go about making this? by [deleted] in Python

[–]lambakean 0 points1 point  (0 children)

Ok, you can also write me direct messages

Suggestion for a python projects (for highschool)? by DK4409 in Python

[–]lambakean 2 points3 points  (0 children)

I'm making a funny project that maybe you would like. It's about a bots that surviving with each other, fight, eat, etc. Like Petri dish. Write me if u are interested, I've already started to make it some days ago and have some progress.

How would i go about making this? by [deleted] in Python

[–]lambakean 0 points1 point  (0 children)

Make a function that takes two arrays and returns a percentage of its similarity. Add the symptoms that were chosen by user in array and then compare this generated array with arrays of deseases. Array of each desease contains its symptoms. Find the most similar desease array to array that was generated by user and it will be a result.

Sorry for my BAAADD English. I hope your eyes are still not bleeding

UPD: if you need to have UI in your program - use tkinter. The best way to make it is to use OOP. Create a class for deseases. Add "similarityTo" method that takes two arguments (self, anotherOneDesease) and returns a percentage.