-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path05-Input_function.py
31 lines (24 loc) · 962 Bytes
/
05-Input_function.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
'''
author : Jaydatt
input function to get input from user as string
data of input always will be string.........
'''
# input function
''' receive the string or value by input '''
name = input("Enter the name:") # data of input always will be string.........
print(type(name))
a = input("Enter the fist value:") # data of input always will be string.........
x = int(a) # so we need to convert string to integer
b = input("Enter the second value:") # data of input always will be string.........
y = int(b) # so we need to convert string to integer
z = (x + y)/2
print('Average of x and y is',z)
### Fix Enter Input in integer and float............
print('\nEnter Input in integer and float............')
m1 = int(input("Enter Marks1 in integer: "))
m2 = int(input("Enter Marks2 in integer: "))
m3 = float(input("Enter Marks3 in float: "))
m4 = float(input("Enter Marks4 in float: "))
myList = [m1, m2, m3, m4]
myList.sort()
print('\n',myList)