Hastumer
Umarmt Bäume.
Heyho, ich hab ein kleines Programm in Python geschrieben, was euch Radiant in Grad umrechnen kann oder auch anders herum. Es hat nur 21 Zeilen
Downloadlink: https://drive.google.com/file/d/0B2ff34qfW0doS3dzbFBvYTFTMDQ/view?usp=sharing
Windows Executable: Leider funktioniert py2exe bei mir nicht, falls mir das einer schicken kann, wäre ich extremst dankbar
Code:
rad = 57.29577951
deg = 0.017453293
direction = [COLOR="#4B0082"]input[/COLOR]([COLOR="#00CC00"]"Enter \"Deg-Rad\" for Degrees into Radians or \"Rad-Deg\" for Radians into Degrees!\n"[/COLOR])
number = [COLOR="#4B0082"]float[/COLOR]([COLOR="#4B0082"]Input[/COLOR]([COLOR="#00CC00"]"\n\nEnter the number you want to calculate!\n"[/COLOR]))
printTemp = number
foo = [COLOR="#FFFF00"]False[/COLOR]
[COLOR="#FFFF00"]try[/COLOR]:
[COLOR="#FFFF00"]if[/COLOR] direction == [COLOR="#00CC00"]"Deg-Rad"[/COLOR]:
number = number * rad
[COLOR="#4B0082"]print[/COLOR]([COLOR="#00CC00"]"\n\n"[/COLOR] + [COLOR="#4B0082"]str[/COLOR](printTemp) + [COLOR="#00CC00"]"° is equal to approximately "[/COLOR] + [COLOR="#4B0082"]str[/COLOR](number) + [COLOR="#00CC00"]" rad!"[/COLOR])
[COLOR="#FFFF00"]elif[/COLOR] direction == [COLOR="#00CC00"]"Rad-Deg"[/COLOR]:
number = number * deg
[COLOR="#4B0082"]print[/COLOR]([COLOR="#00CC00"]"\n\n"[/COLOR] + [COLOR="#4B0082"]str[/COLOR](printTemp) + [COLOR="#00CC00"]" rad is equal to approximately "[/COLOR] + [COLOR="#4B0082"]str[/COLOR](number) + [COLOR="#00CC00"]"°!"[/COLOR])
[COLOR="#FFFF00"]else[/COLOR]:
[COLOR="#4B0082"]print[/COLOR]([COLOR="#00CC00"]"\n\nI SAID YOU SHOULD WRITE \"Deg-Rad\" OR \"Rad-Deg\"!!!"[/COLOR])
number = [COLOR="#4B0082"]Input[/COLOR]()
foo = [COLOR="#FFFF00"]True[/COLOR]
[COLOR="#FFFF00"]finally[/COLOR]:
[COLOR="#FFFF00"]if not[/COLOR] foo:
[COLOR="#4B0082"]print[/COLOR]([COLOR="#00CC00"]"Oops! Something went badly wrong."[/COLOR])
number = [COLOR="#4B0082"]Input[/COLOR]()
Downloadlink: https://drive.google.com/file/d/0B2ff34qfW0doS3dzbFBvYTFTMDQ/view?usp=sharing
Windows Executable: Leider funktioniert py2exe bei mir nicht, falls mir das einer schicken kann, wäre ich extremst dankbar
Zuletzt bearbeitet: