Static Values:
Give the values at compile time
Example:
a=10
b=3.2
ch='A'
s="GPR Computers"
print(a)
print(b)
print(ch)
print(s)
Output:
10
3.2
A
GPR Computers
Dynamic
Values:
It is used to take the input from the keyboard at
runtime.
input(): This
function is used to read the string value.
int(input()):
This function read the integer value.
float(input()):
This function read the float value.
Example:
a=int(input("Enter a value\n"))
b=float(input("Enter b value\n"))
ch=input("Enter ch value\n")
s=input("Enter s value\n")
print(a)
print(b)
print(ch[0])
print(s)
Output:
Enter a value
10
Enter b value
3.53
Enter ch value
A
Enter s value
GPR Computers
10
3.53
A
GPR Computers
Comments
Post a Comment