What are the changes required for the same code written in Python 2.7.3 before and now it needs to be executed in Python 3.3?
The code is :-
nm = input(“enter your name “)
str = raw_input(“enter ur details: \n”)
f = open(nm,”w”)
f.write(str)
f.close()
print “1.See the file\n”
print “2.Exit\n”
s = input(“enter ur preference “)
if s == 1 :
fi = open(nm,”r”)
cont = fi.readlines()
for i in cont:
print i
else :
print “thank you, goodbye “
Please point out the changes to be made so that it runs without any error in Python 3.3