Commit 46086b23 authored by Mihai's avatar Mihai

Switch some examples to python3

parent 2b90450d
...@@ -8,4 +8,4 @@ def calc_gc_percent(seq): ...@@ -8,4 +8,4 @@ def calc_gc_percent(seq):
return gc_count * 100.0 / (gc_count + at_count) return gc_count * 100.0 / (gc_count + at_count)
print "The sequence 'CAGG' has a %GC of {:.2f}".format(calc_gc_percent("CAGG")) print("The sequence 'CAGG' has a %GC of {:.2f}".format(calc_gc_percent("CAGG")))
...@@ -10,4 +10,4 @@ def calc_gc_percent(seq): ...@@ -10,4 +10,4 @@ def calc_gc_percent(seq):
return gc_count * 100.0 / (gc_count + at_count) return gc_count * 100.0 / (gc_count + at_count)
print "The sequence 'CAGG' has a %GC of {:.2f}".format(calc_gc_percent("CAGG")) print("The sequence 'CAGG' has a %GC of {:.2f}".format(calc_gc_percent("CAGG")))
...@@ -13,4 +13,4 @@ def calc_gc_percent(seq): ...@@ -13,4 +13,4 @@ def calc_gc_percent(seq):
return gc_count * 100.0 / (gc_count + at_count) return gc_count * 100.0 / (gc_count + at_count)
input_seq = sys.argv[1] input_seq = sys.argv[1]
print "The sequence '{}' has a %GC of {:.2f}".format(input_seq, calc_gc_percent(input_seq)) print("The sequence '{}' has a %GC of {:.2f}".format(input_seq, calc_gc_percent(input_seq)))
...@@ -13,4 +13,4 @@ def calc_gc_percent(seq): ...@@ -13,4 +13,4 @@ def calc_gc_percent(seq):
return gc_count * 100.0 / (gc_count + at_count) return gc_count * 100.0 / (gc_count + at_count)
input_seq = sys.argv[1] input_seq = sys.argv[1]
print "The sequence '{}' has a %GC of {:.2f}".format(input_seq, calc_gc_percent(input_seq)) print("The sequence '{}' has a %GC of {:.2f}".format(input_seq, calc_gc_percent(input_seq)))
...@@ -25,4 +25,4 @@ def calc_gc_percent(seq): ...@@ -25,4 +25,4 @@ def calc_gc_percent(seq):
return gc_count * 100.0 / (gc_count + at_count) return gc_count * 100.0 / (gc_count + at_count)
input_seq = sys.argv[1] input_seq = sys.argv[1]
print "The sequence '{}' has a %GC of {:.2f}".format(input_seq, calc_gc_percent(input_seq)) print("The sequence '{}' has a %GC of {:.2f}".format(input_seq, calc_gc_percent(input_seq)))
...@@ -28,4 +28,4 @@ def calc_gc_percent(seq): ...@@ -28,4 +28,4 @@ def calc_gc_percent(seq):
return gc_count * 100.0 / (gc_count + at_count) return gc_count * 100.0 / (gc_count + at_count)
input_seq = sys.argv[1] input_seq = sys.argv[1]
print "The sequence '{}' has a %GC of {:.2f}".format(input_seq, calc_gc_percent(input_seq)) print("The sequence '{}' has a %GC of {:.2f}".format(input_seq, calc_gc_percent(input_seq)))
...@@ -32,4 +32,4 @@ def calc_gc_percent(seq): ...@@ -32,4 +32,4 @@ def calc_gc_percent(seq):
return 0.0 return 0.0
input_seq = sys.argv[1] input_seq = sys.argv[1]
print "The sequence '{}' has a %GC of {:.2f}".format(input_seq, calc_gc_percent(input_seq)) print("The sequence '{}' has a %GC of {:.2f}".format(input_seq, calc_gc_percent(input_seq)))
...@@ -33,4 +33,4 @@ def calc_gc_percent(seq): ...@@ -33,4 +33,4 @@ def calc_gc_percent(seq):
if __name__ == '__main__': if __name__ == '__main__':
input_seq = sys.argv[1] input_seq = sys.argv[1]
print "The sequence '{}' has a %GC of {:.2f}".format(input_seq, calc_gc_percent(input_seq)) print("The sequence '{}' has a %GC of {:.2f}".format(input_seq, calc_gc_percent(input_seq)))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment