-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added hello-world and if-else-statements source code
- Loading branch information
Carlos Eduardo Witte
authored and
Carlos Eduardo Witte
committed
Feb 20, 2024
1 parent
0a9590b
commit 8950c03
Showing
4 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"folders": [ | ||
{ | ||
"path": ".." | ||
} | ||
], | ||
"settings": {} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from python import Python | ||
|
||
fn main() raises: | ||
let py = Python.import_module('builtins') | ||
let user_input = py.input('What is your name? ') | ||
|
||
print('Hello World from Mojo,', user_input) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from python import Python | ||
|
||
fn main() raises: | ||
let py = Python.import_module('builtins') | ||
let user_input = atol(py.input('Give me a number:')) | ||
|
||
if user_input >= 100: | ||
print('Value is equal or above 100') | ||
elif user_input < 100 and user_input >50: | ||
print('Value is betwenn 51 and 99') | ||
else: | ||
print('Value is equal or below 50') |