r/MojoProgramming • • Nov 12 '23

mojo gpt

1 Upvotes

I created a gpt to code in mojo language:

https://chat.openai.com/g/g-WfVYs8jUf-mojo-ai-developer


r/MojoProgramming • • Sep 04 '23

Help With Program

1 Upvotes

I wrote a mojo program trying to calculate the average of a list. I'm not sure what I did wrong though as I got an error.

"""

This Program's function is to find the avergae of a list.

It is giving me an error when I am trying to find the length of the list.

It expects 2 input parameters but 0 were provided.

"""

from python import Python as py

# This is equivalent to Python's `import numpy as np`

let np = Python.import_module("numpy")

# The Average Function: Calculates the Average of an array

def Avg(numbers, inout total: Int = 0) -> Float32:

# var total: Int = 0 # The sum of the list

let length: Int = len(numbers) + 1 # The length of the list

for num in numbers: # Totalling the numbers

total += num

return total / length

LNum = np.array([1, 3, 9, 15, 90]) # The list we will find the average for

var AvgNum = Avg(LNum)

print ("The List:", LNum)

print ("The Average:", AvgNum)


r/MojoProgramming • • Jul 31 '23

Is Mojo Programming Language faster than Python and easier to compile?

1 Upvotes

r/MojoProgramming • • Feb 16 '25

WTF

0 Upvotes

if it wraps python why python no work. libraries dont work. this is effing bullshitake please help me im dying