This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #""" | |
| #A start of a 3D engine. Use``OK`` to display the faces or edges of cube and ``←↑→↓+-`` to move it. | |
| #**NOTE**: This script work better on Upsilon because ``fill_polygon()`` function doesn't exist in others OS. So we need to re-implement this and is consuming a lot of resources. | |
| #Source: https://my.numworks.com/python/antarctus/cube_move | |
| #""" | |
| #try: | |
| # import os | |
| # if hasattr(os, "environ"): | |
| # os.environ["KANDINSKY_OS_MODE"]= '0' | |
| # os.environ['KANDINSKY_ZOOM_RATIO'] = '2' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from math import* | |
| from turtle import* | |
| speed(10) | |
| hideturtle() | |
| width(2) | |
| up() | |
| goto(0,-90) | |
| down() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from math import * | |
| f = lambda x: 13* sin(x)-12 | |
| driv_f = lambda x: 13*cos(x) | |
| starting_point = -4 | |
| _loop_limits = 20 | |
| _loop_snap_shot = 5 | |
| _ans = starting_point - ( f(starting_point) / driv_f(starting_point)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import math | |
| from math import pi | |
| def decToFrac(): | |
| decimal = float(input("Enter a decimal number to convert to a fraction: ")) | |
| # Handle negative numbers | |
| is_negative = decimal < 0 | |
| decimal = abs(decimal) | |
| # Tolerance for stopping the algorithm |