0Pricing
Mojo Academy · Ders

İlk .mojo Dosyanız

Bir dosya oluşturun ve Hello, world yazdırın.

İlk .mojo Dosyanız, CoddyKit'te ücretsiz bir Mojo Academy dersidir. Bu, 4 dersinin 1. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, Mojo Academy öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Mojo Academy kursu toplamda 4 dersten oluşur.

Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.

A File to Hold Your Code

Mojo programs live in plain text files. Each one ends with the .mojo extension so the toolchain knows how to compile and run it. 📄

Name It Clearly

Pick a short, lowercase name like hello.mojo. A clear file name makes it obvious what the program does when you come back later.

hello.mojo

The .mojo and .🔥 Twist

Mojo even allows the fire emoji as an extension, so hello.🔥 is valid too. Most people stick with .mojo for everyday work though.

Print Your First Line

The classic first program prints a greeting. In Mojo you use print, just like Python, to send text to the screen.

print("Hello, world!")

Code Goes Inside main

Your runnable code belongs in a function called main. Mojo looks for it as the starting point when the file runs.

def main():
    print("Hello, world!")

Indentation Marks the Block

Like Python, Mojo uses indentation to group code. The print line is indented under main, showing it belongs to that function.

def main():
    print("Hello, world!")

Save the File

Type the code in your editor and save it as hello.mojo. Nothing runs until you save, so this step matters before you try it.

Change the Message

The text inside the quotes is yours to edit. Swap it for a string like your name to make the program feel like your own.

print("Hello, Mojo learner!")

Strings Need Quotes

Any text you print must sit inside quotes. Without them Mojo treats the words as code and reports an error instead of printing.

print("This is text")

One File, One Program

This single .mojo file is a complete program. It has a main function with one job: greeting you. Small, but truly real Mojo.

Ready to Run

With hello.mojo saved, you have everything needed to run it. The next lessons show how to launch it from the command line.

Quick Check

You just created your first source file. What is the standard extension for a Mojo program?

Recap

You made a .mojo file, put a print call inside main, and saved it. That single file is a complete, ready-to-run Mojo program. 🎯

Sıkça Sorulan Sorular

“İlk .mojo Dosyanız” dersi ücretsiz mi?

Evet — “İlk .mojo Dosyanız” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve Mojo Academy kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Mojo Academy kursu toplamda 4 dersten oluşur.

“İlk .mojo Dosyanız” dersinde ne öğreneceğim?

Bir dosya oluşturun ve Hello, world yazdırın. Mojo Academy ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.

Mojo Academy öğrenmeye başlamak için deneyim gerekli mi?

Önceden deneyim gerekmez. CoddyKit'te Mojo Academy, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 1. dersidir.

“İlk .mojo Dosyanız” dersi ne kadar sürer?

Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.

Bu Mojo Academy dersinde kod yazıp çalıştırabilir miyim?

Evet. Her Mojo Academy dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.

Bu kursun tüm dersleri

  1. İlk .mojo Dosyanız
  2. main Giriş Noktası
  3. mojo run ile Çalıştırma
  4. Mojo REPL'de Keşif
← Mojo Academy Sayfasına Dön