The code editor of VS Code (Monaco): colours, line numbers, brackets and search. Typing help offers statements, functions and their parameters; for Python it comes from Jedi. Tooltips explain the code to beginners.
words = input().split() longest = max(words, key=len) print(longest.upper(), len(words))
the quick brown fox jumps
#include <stdio.h>
int main(void)
{
double price = 1234.5;
int mask = 0x2F;
printf("%8.2lf\n", price);
if (mask == 47) {
printf("%d %c\n", mask, 'A');
}
return 0;
}
Student
- Type
longest.(with the dot) at the end of the program: the methods of a string are offered; Ctrl+Space opens the list any time. - Ctrl+Enter runs the program. Your changes stay in this browser; Restore original brings back the code of the page.
- The theme button switches Light and Dark; Copy copies the code.
- In the C example rest the mouse on
%8.2lf, on==, on0x2For on'A': a tooltip explains the format or the operator, and shows the number in decimal, hexadecimal, binary and octal. - Ctrl and the mouse wheel (or Ctrl and plus or minus) make the code larger or smaller, Ctrl and 0 brings back the normal size; Alt+Z turns word wrap on and off.
Teacher
- Insert an example with the CodeLab button (the </> icon) of the text editor, in any page, lesson, assignment or forum post.
- Choose the language and the theme (Automatic follows the site and the system), and tick Readers can run it.