Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scope #33

Open
srobb1 opened this issue Oct 19, 2019 · 0 comments
Open

scope #33

srobb1 opened this issue Oct 19, 2019 · 0 comments

Comments

@srobb1
Copy link
Collaborator

srobb1 commented Oct 19, 2019

New example for scope using a for loop

#!/usr/bin/env python3

import sys

gene = sys.argv[1] ## user input was brca1
genes = { 'hdac' : 'aaaaa' , 'piwi' : 'ttttt' }

print("Users favorite gene: " , gene)

for gene in genes:
  gene_length = len( genes[gene] )
  print(gene, gene_length)


print("Users favorite gene: " , gene)

Output

(py3.7) mp181vbhv2j:scripts smr$ python3 scope_for_loops.py  brca1
Users favorite gene:  brca1
hdac 5
piwi 5
Users favorite gene:  piwi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant