Attachment 'lec1.py'
Download 1 pi = 3.14159
2 radius = 2.2
3 # area of circle equation <- this is a comment
4 area = pi*(radius**2)
5 print(area)
6
7 # change values of radius <- another comment
8 # use comments to help others understand what you are doing in code
9 radius = radius + 1
10 print(area) # area doesn't change
11 area = pi*(radius**2)
12 print(area)
13
14
15 #############################
16 #### COMMENTING LINES #######
17 #############################
18 # to comment MANY lines at a time, highlight all of them then CTRL+1
19 # do CTRL+1 again to uncomment them
20 # try it on the next few lines below!
21
22 #area = pi*(radius**2)
23 #print(area)
24 #radius = radius + 1
25 #area = pi*(radius**2)
26 #print(area)
27
28 #############################
29 #### AUTOCOMPLETE #######
30 #############################
31 # Spyder can autocomplete names for you
32 # start typing a variable name defined in your program and hit tab
33 # before you finish typing -- try it below
34
35 # define a variable
36 a_very_long_variable_name_dont_name_them_this_long_pls = 0
37
38 # below, start typing a_ve then hit tab... cool, right!
39 # use autocomplete to change the value of that variable to 1
40
41 # use autocomplete to write a line that prints the value of that long variable
42 # notice that Spyder also automatically adds the closed parentheses for you!
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.You are not allowed to attach a file to this page.