IT 210 210
Minnesota State University, Mankato
Popular in Fundamentals of Programming
Popular in Information technology
General Biology 115
verified elite notetaker
This 2 page Class Notes was uploaded by Ahmed Notetaker on Thursday September 22, 2016. The Class Notes belongs to 210 at Minnesota State University - Mankato taught by Salivia, Guarionex in Fall 2016. Since its upload, it has received 8 views. For similar materials see Fundamentals of Programming in Information technology at Minnesota State University - Mankato.
Reviews for IT 210
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 09/22/16
WEEK 1 (FRIDAY) IT 210 #FUNCTIONS def calculateHandshakes(numPeople): n = (numPeople * (numPeople 1)) / 2 return n numOfHandshakes = calculateHandshakes(100) print(numOfHandshakes) #Example: convert miles to inches def milesToInches(miles): feet = 5280 inches = 12 n = miles * feet * inches return n inches = milesToInches(345) print(inches) #def milesToInches(miles): # return miles * 5280 * 12 INCHES = inches // 12 REMAINDER = inches % 12 print(INCHES) print(REMAINDER) def milesToInches_Feet(miles): feet = 5280 inches = 12 i = miles * feet * inches f = int(i // 12) i = i % 12 print(str(miles) + " miles are " + str(f) + " feet and " + str(i) + " inches ") milesToInches_Feet(347.589999) #Iterators for i in range(10): print(i) #example 1 x = 0 for i in range(31): x = x + i print(x) #example 2: Factorial def factorial(n): x = 1 for i in range(1, n + 1): x = x * i return x fac_10 = factorial(10) print(fac_10) #MODULES import turtle #wn = turtle.Screen() #sven = turtle.Turtle() # sven.forward(100) # print(str(sven.position())) # sven.up() # sven.goto(100, 200) # sven.down() # sven.goto(100, 200) # wn.exitonclick() def drawSquare(t, sideLength): for i in range(4): t.forward(sideLength) t.right(90) #degrees def drawRectangle(t, sideLength1, sideLength2): for i in range(2): t.forward(sideLength1) t.right(90) #degrees t.forward(sideLength2) t.right(90) # degrees #RANGE FUNCTION #range(stop): sequence of numbers from 0 to stop 1 #range(start, stop): sequence of numbers from start to stop 1 #range(start, stop, step): sequence of numbers from start to stop 1 counting by step def drawSpiral(aTurtle, maxSide): delta = 5 for sideLength in range(1, maxSide + 1, delta): aTurtle.forward(sideLength) aTurtle.right(90) wn = turtle.Screen() sven = turtle.Turtle() #drawSquare(sven, 10) #drawRectangle(sven, 150, 100) drawSpiral(sven, 300) wn.exitonclick()
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'