Input Function In Python

Input Function In Python


TRY THE FOLLOWING COMMANDS ONE BY ONE

  1. print("Enter your name")
    name=input()
    print("My name is "+name)
     
  2. name=input("Enter your name")
    print("My name is "+name)
     
  3. name=input("Enter your name\n")
    print("My name is "+name)
     
  4. a=input("Enter a Number")
    print(a)
     
  5. a=input("Enter a Number\n")
    print("Value of a is "+a)
     
  6. a=input("Enter First Number\n")
    b=input("Enter Second Number\n")
    c=a+b
    print("Sum of a and b is "+c)
     
  7. 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)
     
  8. 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))
     
  9. 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))
     
  10. 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))
     
  11. 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))

TO SEE HOW TO USE ABOVE COMMANDS WATCH THE FOLLOWING VIDEO



Popular posts from this blog

IGNOU Solved Assignment 2023-24 | BCS-012 Basic Mathematics BCA(I)012/Assignment/2023-24

MCS-051 : ADVANCED INTERNET TECHNOLOGIES | 1. (a) Write a web application using JSP and JDBC that takes a bank account number as input and displays the account balance.

MCS054 TEE June 2021 Q1(b) | Bisection Method