Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Programming homework (Python) - Help!
New Posts  All Forums:Forum Nav:

Programming homework (Python) - Help! - Page 2

post #11 of 14
Thread Starter 
Quote:
Originally Posted by Poseiden View Post

Guy's we need to watch out. We have just unleashed a beast into this world!biggrin.gif But ya, python is nice and friendly.

Hahaha! I hope so. This is all from just playing around in Python. I have course material("The Practice of Computing Using Python") but I haven't read it yet!

Later this year, I take Java, I wonder how friendly that is.
Po' Pimpin'
(11 items)
 
  
CPUMotherboardRAMHard Drive
i5 2500k @ stock Biostar TZ68K+ [A3] 4GB  Sandforce 1222 64GB SSD 
Optical DriveCoolingOSMonitor
LG 22x DVD-+RW  Stock Windows 7 x64 Acer S211HL 1080p 
PowerCaseMouse
600w Diablotek Linkworld Electronic Inland 
  hide details  
Reply
Po' Pimpin'
(11 items)
 
  
CPUMotherboardRAMHard Drive
i5 2500k @ stock Biostar TZ68K+ [A3] 4GB  Sandforce 1222 64GB SSD 
Optical DriveCoolingOSMonitor
LG 22x DVD-+RW  Stock Windows 7 x64 Acer S211HL 1080p 
PowerCaseMouse
600w Diablotek Linkworld Electronic Inland 
  hide details  
Reply
post #12 of 14
Java is decidedly much LESS friendly than Python, but that's not surprising since it's a statically-typed, pure object-oriented language. However, it's still not hard to learn and once you get the hang of it it's not bad at all.
SG06
(16 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i5-3570S 65W ASRock Z77E-ITX VisionTek AMD Radeon RX 480 8GB Reference G.SKILL Sniper DDR3-2400 (@ 1866 9-10-10-28) 2x8GB 
Hard DriveHard DriveCoolingCooling
Crucial m4 256GB Toshiba P300 3TB Prolimatech Samuel 17 Noctua NF-F12 
OSMonitorMonitorKeyboard
Windows 10 Pro x64 HP Omen 32" HP Pavilion 27xi Das Model S Professional Silent 
PowerCaseMouseAudio
Silverstone SST-ST45SF Silverstone SG06 Microsoft Intellimouse Realtek ALC898 
  hide details  
Reply
SG06
(16 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i5-3570S 65W ASRock Z77E-ITX VisionTek AMD Radeon RX 480 8GB Reference G.SKILL Sniper DDR3-2400 (@ 1866 9-10-10-28) 2x8GB 
Hard DriveHard DriveCoolingCooling
Crucial m4 256GB Toshiba P300 3TB Prolimatech Samuel 17 Noctua NF-F12 
OSMonitorMonitorKeyboard
Windows 10 Pro x64 HP Omen 32" HP Pavilion 27xi Das Model S Professional Silent 
PowerCaseMouseAudio
Silverstone SST-ST45SF Silverstone SG06 Microsoft Intellimouse Realtek ALC898 
  hide details  
Reply
post #13 of 14
Thread Starter 
I'm finally finished! Thank you guys so much for the help and I didn't have to look at you guys' code.
Code:
#===============================================================================
#
# MAIN
#
#===============================================================================

#The superhero known as the UberGeek is trapped in a small room inside of a saltmine. To escape, the geek must cut
#a 1 meter cylinder through 25 meters of salt using a high-power laser. The result is a cylindrical volume of salt that
#has to be moved.

#Import Math Library
import math
#Definitions of Variables
circleradius = 1
cylinderheight = 25
AreaofCircle = math.pi*circleradius**2
Volumeofcylinder = math.pi*circleradius**2*cylinderheight 
VolumeofcylinderMilliliter = Volumeofcylinder * 1000000
densityofsalt = 2.15*VolumeofcylinderMilliliter
massofcylinderkilograms = densityofsalt/1000

#Print results to the screen
print ('Radius of circle is: %s meter' % circleradius)
print ('Height of cylinder is: %s meters' % cylinderheight)
print ('Area of Circle is: %s meters squared' % AreaofCircle)
print ('Volume of Cylinder is: %s meters cubed' % Volumeofcylinder)
print ('Vol of Cyl in ML is: %s cubic ML' % VolumeofcylinderMilliliter)
print ('Density of Salt is: %s grams' % densityofsalt)
print ('Mass of Cylinder in Kilograms is: %s kilograms' % massofcylinderkilograms)
Po' Pimpin'
(11 items)
 
  
CPUMotherboardRAMHard Drive
i5 2500k @ stock Biostar TZ68K+ [A3] 4GB  Sandforce 1222 64GB SSD 
Optical DriveCoolingOSMonitor
LG 22x DVD-+RW  Stock Windows 7 x64 Acer S211HL 1080p 
PowerCaseMouse
600w Diablotek Linkworld Electronic Inland 
  hide details  
Reply
Po' Pimpin'
(11 items)
 
  
CPUMotherboardRAMHard Drive
i5 2500k @ stock Biostar TZ68K+ [A3] 4GB  Sandforce 1222 64GB SSD 
Optical DriveCoolingOSMonitor
LG 22x DVD-+RW  Stock Windows 7 x64 Acer S211HL 1080p 
PowerCaseMouse
600w Diablotek Linkworld Electronic Inland 
  hide details  
Reply
post #14 of 14
Thread Starter 
Heres a bonus worth 20 points. If you guys have any ideas.
Quote:
Given: Python has a built in module that allows simple drawing tools in the Logos pattern. This package is called
Turtle.
Turtle commands include:
turtle.speed(n) -Set the speed of the turtle
turtle.penup() -take the pen off the drawing surface
turtle.pendown() -put the pen on the drawing surface
turtle.setpos(x,y) -put the pen at a location x,y
turtle.circle(r) -draw a circle of radius r
turtle.ht() -hide the pen marker
turtle.exitonclick()-set the window to disappear on a mouse click
turtle.bye() -dismiss the turtle drawing window immediately

Find: Using your knowledge of Python, turtle, and mathematics, draw the following figure using Python. Hint: This
is called a four-leaf rose, using polar coordinates. Good luck!
Po' Pimpin'
(11 items)
 
  
CPUMotherboardRAMHard Drive
i5 2500k @ stock Biostar TZ68K+ [A3] 4GB  Sandforce 1222 64GB SSD 
Optical DriveCoolingOSMonitor
LG 22x DVD-+RW  Stock Windows 7 x64 Acer S211HL 1080p 
PowerCaseMouse
600w Diablotek Linkworld Electronic Inland 
  hide details  
Reply
Po' Pimpin'
(11 items)
 
  
CPUMotherboardRAMHard Drive
i5 2500k @ stock Biostar TZ68K+ [A3] 4GB  Sandforce 1222 64GB SSD 
Optical DriveCoolingOSMonitor
LG 22x DVD-+RW  Stock Windows 7 x64 Acer S211HL 1080p 
PowerCaseMouse
600w Diablotek Linkworld Electronic Inland 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Programming homework (Python) - Help!