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 builtin.io import _dup | |
from memory import UnsafePointer, memcpy | |
from sys import os_is_windows, external_call | |
@value | |
struct stdin: | |
"""A read only file handle to the stdin stream.""" | |
alias file_descriptor = 0 |
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
# Cool Mojo Calculator | |
from types.input.input import input | |
def is_float(given_string: String) -> Bool: | |
# Given a string, go through each character and check if it is a digit or a dot. | |
for i in range(len(given_string)): | |
# If the character is a dot, check if it is the last character in the string. | |
if given_string[i] == "." and i == len(given_string) - 1: | |
return False | |
# Normal case, check if the character is a digit or a dot. |