
The print() function is used to display output.
print("Hello, World!")
print("The sum of 2 + 3 is", 2 + 3)
Output:
Hello, World!
The sum of 2 + 3 is 5
The input() function is used to take input from the user.
name = input("Enter your name: ")
print("Hello,", name)
Example Run:
Enter your name: Alice
Hello, Alice
input() returns data as a string.int() or float():age = int(input("Enter your age: "))
print("Next year you will be", age + 1)
You can use both together to make interactive programs:
num1 = int(input("Enter first number: "))
num2 = int(input("Enter second number: "))
print("The sum is", num1 + num2)
Example Run:
Enter first number: 10
Enter second number: 20
The sum is 30
Fill out the Get Help form and our team will contact you.
We accept UPI, Debit/Credit Cards, and Net Banking.
Yes, installment options are available for selected courses.
Yes, we provide resume and interview support.