Attachment 'lec2.py'

Download

   1 ###################
   2 ## EXAMPLE: strings 
   3 ###################
   4 #hi = "hello there"
   5 #name = "ana"
   6 #greet = hi + name  
   7 #print(greet)
   8 #greeting = hi + " " + name
   9 #print(greeting)
  10 #silly = hi + (" " + name)*3
  11 #print(silly)
  12 
  13 ####################
  14 ## EXAMPLE: output 
  15 ####################
  16 #x = 1
  17 #print(x)
  18 #x_str = str(x)
  19 #print("my fav number is", x, ".", "x=", x)
  20 #print("my fav number is", x_str + "." + "x=" + x_str)
  21 #print("my fav number is" + x_str + "." + "x=" + x_str)
  22 
  23 
  24 ####################
  25 ## EXAMPLE: input
  26 ####################
  27 #text = input("Type anything... ")
  28 #print(5*text)
  29 #num = int(input("Type a number... "))
  30 #print(5*num)
  31 
  32 
  33 ####################
  34 ## EXAMPLE: conditionals/branching 
  35 ####################
  36 #x = float(input("Enter a number for x: "))
  37 #y = float(input("Enter a number for y: "))
  38 #if x == y:
  39 #    print("x and y are equal")
  40 #    if y != 0:
  41 #        print("therefore, x / y is", x/y)
  42 #elif x < y:
  43 #    print("x is smaller")
  44 #elif x > y:
  45 #    print("y is smaller")
  46 #print("thanks!")
  47 
  48 
  49 
  50 ####################
  51 ## EXAMPLE: remainder 
  52 ####################
  53 #num = int(input("Enter a number: "))
  54 #if num % 2 == 0:
  55 #    print("number is even")
  56 #else:
  57 #    print("number is odd")
  58 
  59 
  60 ####################
  61 ## EXAMPLE: while loops 
  62 ## Try expanding this code to show a sad face if you go right
  63 ## twice and flip the table any more times than that. 
  64 ## Hint: use a counter
  65 ####################
  66 #n = input("You are in the Lost Forest\n****************\n****************\n :)\n****************\n****************\nGo left or right? ")
  67 #while n == "right" or n == "Right":
  68 #    n = input("You are in the Lost Forest\n****************\n******       ***\n  (╯°□°)╯︵ ┻━┻\n****************\n****************\nGo left or right? ")
  69 #print("\nYou got out of the Lost Forest!\n\o/")
  70 
  71 
  72 
  73 #n = 0
  74 #while n < 5:
  75 #    print(n)
  76 #    n = n+1
  77 
  78 
  79 ####################
  80 ## EXAMPLE: for loops
  81 ####################
  82 #for n in range(5):
  83 #    print(n)
  84 #
  85 #mysum = 0
  86 #for i in range(10):
  87 #    mysum += i
  88 #print(mysum)
  89 #
  90 #mysum = 0
  91 #for i in range(7, 10):
  92 #    mysum += i
  93 #print(mysum)
  94 #
  95 #mysum = 0
  96 #for i in range(5, 11, 2):
  97 #    mysum += i
  98 #    if mysum == 5:
  99 #        break
 100 #        mysum += 1
 101 #print(mysum)
 102 
 103 
 104 
 105 ####################
 106 ## EXAMPLE: perfect squares
 107 ####################
 108 #ans = 0
 109 #neg_flag = False
 110 #x = int(input("Enter an integer: "))
 111 #if x < 0:
 112 #    neg_flag = True
 113 #while ans**2 < x:
 114 #    ans = ans + 1
 115 #if ans**2 == x:
 116 #    print("Square root of", x, "is", ans)
 117 #else:
 118 #    print(x, "is not a perfect square")
 119 #    if neg_flag:
 120 #        print("Just checking... did you mean", -x, "?")
 121 
 122 
 123 ####################
 124 ## TEST YOURSELF!
 125 ## Modify the perfect squares example to print 
 126 ## imaginary perfect sqrts if given a negative num.
 127 ####################

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2017-07-27 19:18:45, 142.4 KB) [[attachment:Acetaminophen_PBPK.cps]]
  • [get | view] (2017-07-31 17:20:41, 1449.3 KB) [[attachment:Andy RK.zip]]
  • [get | view] (2017-07-27 19:18:53, 59.4 KB) [[attachment:BIOMD0000000619.xml]]
  • [get | view] (2017-08-09 16:50:30, 13731.9 KB) [[attachment:Belmonte_thesis.pdf]]
  • [get | view] (2017-07-27 19:33:15, 98.1 KB) [[attachment:Bloomington_and_WoodburnHall.pdf]]
  • [get | view] (2017-08-02 19:58:08, 69593.2 KB) [[attachment:CC3D Intro.pptx]]
  • [get | view] (2017-07-31 16:33:05, 1585.0 KB) [[attachment:CC3D-Computational-TB-Ruggiero.pptx]]
  • [get | view] (2017-07-31 13:39:48, 110507.5 KB) [[attachment:CC3D-Lecture Morning 1 August 2017v4-1.pptx]]
  • [get | view] (2017-07-27 15:39:09, 91.8 KB) [[attachment:CC3D_Quick_Reference_Guide.pdf]]
  • [get | view] (2017-07-27 16:26:46, 43.9 KB) [[attachment:CC3D_card.png]]
  • [get | view] (2017-08-04 21:45:14, 189.5 KB) [[attachment:CancerFLowchart.bmp]]
  • [get | view] (2017-08-04 21:38:26, 180.5 KB) [[attachment:CancerFlowCgart.pdf]]
  • [get | view] (2017-08-04 17:24:52, 5066.1 KB) [[attachment:CellCompartmentsAndLinks.pptx]]
  • [get | view] (2017-08-01 16:43:08, 27.8 KB) [[attachment:Chaotic Lorenz in COPASI.cps]]
  • [get | view] (2017-07-27 19:19:01, 1.1 KB) [[attachment:Critchley_human_APAP_data.csv]]
  • [get | view] (2017-08-02 14:44:17, 550.8 KB) [[attachment:Defining ODEs in COPASI--SBML.pptx]]
  • [get | view] (2017-07-27 19:33:23, 461.2 KB) [[attachment:Detailed_IU_map.png]]
  • [get | view] (2017-08-04 17:40:32, 7.2 KB) [[attachment:DirectedMovement.zip]]
  • [get | view] (2017-08-06 15:35:34, 6.4 KB) [[attachment:EpithelialSheet.zip]]
  • [get | view] (2017-08-04 20:15:18, 3.4 KB) [[attachment:HeikosModel (2).zip]]
  • [get | view] (2017-08-02 16:55:16, 1753.5 KB) [[attachment:Hirashima_et_al-2017-Development_Growt.pdf]]
  • [get | view] (2017-08-04 18:09:11, 132.3 KB) [[attachment:Josua-s Model Development Workflow Gene Expression Mammalian Blastocyst.pdf]]
  • [get | view] (2017-07-30 14:29:04, 29702.4 KB) [[attachment:Monday lectures Python ppt and code.zip]]
  • [get | view] (2017-08-02 19:58:27, 58286.7 KB) [[attachment:MultiScaleModelingWithCC3D-SBML.pptx]]
  • [get | view] (2017-08-01 18:49:13, 7433.6 KB) [[attachment:PBPK_SBML_modeling.pptx]]
  • [get | view] (2017-07-31 21:35:05, 38.2 KB) [[attachment:PK_simple_one_compartment.cps]]
  • [get | view] (2017-07-30 19:38:10, 738.3 KB) [[attachment:Priyom Verbal Model from Mark Alber Epithelial paper with annotations.docx]]
  • [get | view] (2017-07-27 15:34:10, 113.2 KB) [[attachment:PythonRefCard_1p.pdf]]
  • [get | view] (2017-07-27 15:34:51, 1634.3 KB) [[attachment:PythonRefCard_8p.pdf]]
  • [get | view] (2017-07-31 17:20:59, 19455.7 KB) [[attachment:Slides_ReactionKinetics-2.pptx]]
  • [get | view] (2017-07-30 17:31:42, 97.3 KB) [[attachment:WP_20170730_13_29_10_small.jpg]]
  • [get | view] (2017-07-31 18:01:31, 118.2 KB) [[attachment:WP_20170731_13_10_15_Pro.jpg]]
  • [get | view] (2017-07-27 16:27:11, 36.5 KB) [[attachment:beginners_python_cheat_sheet_pcc_SELECTED.png]]
  • [get | view] (2017-08-04 17:40:39, 13.1 KB) [[attachment:cellcycle_DN.zip]]
  • [get | view] (2017-08-04 17:47:09, 92.6 KB) [[attachment:class_photo.jpg]]
  • [get | view] (2017-08-02 19:59:01, 34.5 KB) [[attachment:delta-notch.cps]]
  • [get | view] (2017-08-02 20:05:06, 987.6 KB) [[attachment:delta-notch.pptx]]
  • [get | view] (2017-08-04 17:20:05, 5.8 KB) [[attachment:gradient_1.zip]]
  • [get | view] (2017-08-04 17:20:14, 6.9 KB) [[attachment:gradient_2.zip]]
  • [get | view] (2017-08-04 17:20:24, 6.6 KB) [[attachment:gradient_3.zip]]
  • [get | view] (2017-07-28 21:48:18, 3377.8 KB) [[attachment:holmes_et_al.gene_exp_enh_blas.pdf]]
  • [get | view] (2017-07-28 21:48:28, 2700.3 KB) [[attachment:holmes_sup_material.pdf]]
  • [get | view] (2017-07-31 13:25:51, 18008.4 KB) [[attachment:journal.pcbi.1005533.pdf]]
  • [get | view] (2017-07-30 14:57:48, 921.2 KB) [[attachment:lec1-intro.pptx]]
  • [get | view] (2017-07-30 14:57:40, 1.2 KB) [[attachment:lec1.py]]
  • [get | view] (2017-07-30 14:58:39, 76.8 KB) [[attachment:lec2-branching-iteration.pptx]]
  • [get | view] (2017-07-30 14:57:55, 2.8 KB) [[attachment:lec2.py]]
  • [get | view] (2017-07-30 14:58:57, 61.3 KB) [[attachment:lec3-strings-approximations.pptx]]
  • [get | view] (2017-07-30 14:58:46, 2.9 KB) [[attachment:lec3.py]]
  • [get | view] (2017-07-30 14:59:04, 1342.3 KB) [[attachment:lec4-basic-functions.pptx]]
  • [get | view] (2017-07-30 14:59:23, 2097.2 KB) [[attachment:lec5-tuple-lists.pdf]]
  • [get | view] (2017-07-30 14:59:15, 4.5 KB) [[attachment:lec5_tuples_lists.py]]
  • [get | view] (2017-07-30 14:59:47, 287.6 KB) [[attachment:lec6-dictionaries.pptx]]
  • [get | view] (2017-07-30 14:59:28, 4.6 KB) [[attachment:lec6.py]]
  • [get | view] (2017-07-30 14:59:39, 4.6 KB) [[attachment:lec6_recursion_dictionaries.py]]
  • [get | view] (2017-07-30 14:59:58, 20274.9 KB) [[attachment:lec7-random-walk.pptx]]
  • [get | view] (2017-08-09 16:50:37, 584.2 KB) [[attachment:parameter-scan.pdf]]
  • [get | view] (2017-07-27 16:26:57, 31.3 KB) [[attachment:python_refcard.png]]
  • [get | view] (2017-08-01 18:56:32, 3390.1 KB) [[attachment:s13628-015-0022-x.pdf]]
  • [get | view] (2017-07-28 18:54:30, 22.2 KB) [[attachment:schedule.docx]]
  • [get | view] (2017-07-28 18:54:20, 301.5 KB) [[attachment:schedule.pdf]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.