1// Both languages are great for beginners. However, they have their
2// differences. Java is an object-oriented programming language,
3// whereas Python is often considered to be a scripting language.
1Getting input from user , python & java
2
3JAVA:
4
5
6class HelloWorld {
7 public static void main(String[] args) {
8 Scanner myObj = new Scanner(System.in); // Create a Scanner object
9 System.out.println("Enter username");
10
11 String userName = myObj.nextLine(); // Read user input
12 System.out.println("Username is: " + userName); // Output user input
13 }
14}
15
16PYTHON:
17
18input = input('Enter username:')
19print('Username is:', input)