File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Intro to Python for Data Science Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 1+ #------------------------------------------------------------------------------------------------------------#
12# Familiar functions
23# Create variables var1 and var2
34var1 = [1 , 2 , 3 , 4 ]
1112
1213# Convert var2 to an integer: out2
1314out2 = int (var2 )
15+ #------------------------------------------------------------------------------------------------------------#
1416
1517# Multiple arguments
1618# Create lists first and second
2527
2628# Print out full_sorted
2729print (full_sorted )
30+ #------------------------------------------------------------------------------------------------------------#
2831
2932#String Methods
3033# string to experiment with: room
3942
4043# Print out the number of o's in room
4144print (room .count ("o" ))
45+ #------------------------------------------------------------------------------------------------------------#
4246
4347#List Methods
4448# Create list areas
4953
5054# Print out how often 14.5 appears in areas
5155print (areas .count (14.5 ))
56+ #------------------------------------------------------------------------------------------------------------#
5257
5358#List Methods (2)
5459# Create list areas
5762# Use append twice to add poolhouse and garage size
5863areas .append (24.5 )
5964areas .append (15.45 )
65+ #------------------------------------------------------------------------------------------------------------#
66+ #------------------------------------------------------------------------------------------------------------#
6067
6168# Print out areas
6269print (areas )
6673
6774# Print out areas
6875print (areas )
76+ #------------------------------------------------------------------------------------------------------------#
6977
7078#Import package
7179# Definition of radius
7987
8088# Calculate A
8189A = math .pi * r ** 2
90+ #------------------------------------------------------------------------------------------------------------#
8291
8392# Build printout
8493print ("Circumference: " + str (C ))
8594print ("Area: " + str (A ))
95+ #------------------------------------------------------------------------------------------------------------#
8696
8797#Selective import
8898# Definition of radius
97107# Print out dist
98108print (dist )
99109
110+ #------------------------------------------------------------------------------------------------------------#
100111
You can’t perform that action at this time.
0 commit comments