Syntax error on token “;”, { expected after this token in Random string creator

In Java, you cannot directly write the executable statements in class. You need to move your code in a method. Only variables declaration is allowed outside the method/blocks. Just for the sake of testing, ,move everthing to main method. Try this: Note: system.out.println(arrayList); will throw an error because there is no varaible called arrayList, i think it should … Read more

Different meanings of brackets in Python

[]: Lists and indexing/lookup/slicing Lists: [], [1, 2, 3], [i**2 for i in range(5)] Indexing: ‘abc'[0] → ‘a’ Lookup: {0: 10}[0] → 10 Slicing: ‘abc'[:2] → ‘ab’ (): Tuples, order of operations, generator expressions, function calls and other syntax. Tuples: (), (1, 2, 3) Although tuples can be created without parentheses: t = 1, 2 → (1, 2) Order of operations: (n-1)**2 Generator expression: (i**2 for i in range(5)) Function or method calls: print(), int(), range(5), ‘1 2’.split(‘ … Read more