My code is not working

let builtins = Python.import('builtins'); let array = Python.import('array'); the import on both of these is red and swiggly, the full code is from python import Python; let builtins = Python.import('builtins'); let array = Python.import('array'); fn reverse_words(input: String): var words: String[] = builtins.input.split(" ");
var reversed: String = words.reverse().join(" ");
return reversed; fn main(): var input = builtins.input("Enter a sentence: "); var reversed_text = reverse_words(input); builtins.print("Reversed text: " + reversed_text);
1 Reply
Alex Kirchhoff
Alex Kirchhoff13mo ago
At this time, I don't believe global variables have been implemented, so you may need to move your let builtins = ... into the individual functions you want to use those modules within.
Want results from more Discord servers?
Add your server