Sublime Forum

Python True/False

#1

Hi everyone,
I am very new to sublime and have the following issue:

When I want to run a simple true/false check with python, I just receive “[Finished in 0.0s]” without a True/False statement.
Specifically, as an example. I wrote:

motif=‘gtccc’
dna=‘atatagatgatgcctt’
motif in dna

I get the same when I just type 0<1 etc.

Do you know what seems to be the issue here? Otherwise python works perfectly fine in sublime.

Thanks a lot for your support!

0 Likes

#2

When you use Sublime to execute Python code, it tells the external Python interpreter “hey, run this code”.

The statement motif in dna is something that returns a boolean, but you didn’t tell Python that it should print the result, you only asked it to check, which it helpfully did.

If you want your Python program to generate output, you need to tell it explicitly what to print.

print(motif in dna) will do what you want.

0 Likes

#3

Perfect, thanks so much!!

0 Likes