Avatto>>DATA SCIENTIST>>SHORT QUESTIONS>>Python Interview Questions
if salary>20000:
  ​print(“Good Salary”)
elif salary<20000
  ​ print(“Average Salary”)
else
  ​print(“Salary is 20000”)
lucky_number = {‘Amit’:4,’Rahul’:6,’Nihar’:8}
for name,number in lucky_number.items():
  ​print(name+’prefers’+str(number))
lucky_number = {‘Amit’:4,’Rahul’:6,’Nihar’:8}
for name in lucky_number.keys():
print(name)
filename = 'abc.txt'
with open(filename) as file_object:
  ​lines = file_object.readlines()
for line in lines:
  ​print(line)
x = “What is your age?”
inp = input(x)
try:
​inp = int(inp)
except ValueError:
  ​print(“Sorry, Please Try again latter”)
else:
  ​print(“That’s a beautiful age “)


Description