Input Function In Python
Input Function In Python
TRY THE FOLLOWING COMMANDS ONE BY ONE
- print("Enter your name")
name=input()
print("My name is "+name)
- name=input("Enter your name")
print("My name is "+name)
- name=input("Enter your name\n")
print("My name is "+name)
- a=input("Enter a Number")
print(a)
- a=input("Enter a Number\n")
print("Value of a is "+a)
- a=input("Enter First Number\n")
b=input("Enter Second Number\n")
c=a+b
print("Sum of a and b is "+c)
- a=int(input("Enter First Number\n"))
b=int(input("Enter Second Number\n"))
c=a+b
print("Sum of a and b is "+c)
- a=int(input("Enter First Number\n"))
b=int(input("Enter Second Number\n"))
c=a+b
print("Sum of a and b is "+str(c))
- a=float(input("Enter First Number\n"))
b=float(input("Enter Second Number\n"))
c=a+b
print("Sum of a and b is "+str(c))
- a=double(input("Enter First Number\n"))
b=double(input("Enter Second Number\n"))
c=a+b
print("Sum of a and b is "+str(c))
- a=complex(input("Enter First Number\n"))
b=complex(input("Enter Second Number\n"))
c=a+b
print("Sum of a and b is "+str(c))