И это всё МОЁ
public int foo(int x) {
if(x < 10) {
return 2*x - 1;
} else {
return x % 3 * x - 6;
}
}
public int foo(int x):
if x < 10:
return 2*x - 1
else:
return x % 3 * x - 6
try(Scanner keys = new Scanner(System.in)) {
System.out.print("Enter a number: "
;
int x = Integer.parseInt(keys.nextLine());
System.out.println("Your number was: " + x);
} catch(NumberFormatException e) {
e.printStackTrace();
} finally {
System.out.println("Goodbye"
;
}
try var keys = new Scanner(System.in):
System.out.print("Enter a number: "
int x = Integer.parseInt(keys.nextLine())
System.out.println("Your number was: " + x)
catch NumberFormatException e:
e.printStackTrace()
finally:
System.out.println("Goodbye"
Больше примеров https://github.com/raptor4694/JavaPy
Ну что, пойдут питонисты писать на Джаве или опять что-то не нравится?