Skip to content

Commit 74dcc4c

Browse files
authored
added direct type conversion (codebasics#18)
direct datatype conversion at the time of input
1 parent 7b10130 commit 74dcc4c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Basics/test.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
def sum(a,b):
22
return a+b
33

4-
n1=input('enter first number: ')
5-
n1=int(n1)
6-
n2=input('enter first number: ')
7-
n2=int(n2)
8-
print('sum is: ',sum(n1,n2))
4+
n1=int(input('enter first number: '))
5+
n2=int(input('enter first number: '))
6+
print('sum is: ',sum(n1,n2))

0 commit comments

Comments
 (0)