Questions Bank What will be the output of the following code, located in the p.py file? print(__name__)OpenProgrammingAnswers asked 2 years ago • Python Essentials 2Assuming that the following three files: a.py, b.py, and c.py reside in the same directory, what will be the output produced after running the c.py file? # file a.py print(“a”, end=”) # file b.py import a print(“b”, end=”) # file c.py print(“c”, end=”) import a import bOpenProgrammingAnswers asked 2 years ago • Python Essentials 2The compiled Python bytecode is stored in files which have their names ending with:OpenProgrammingAnswers asked 2 years ago • Python Essentials 2What output will appear after running the following snippet? import math print(dir(math))OpenProgrammingAnswers asked 2 years ago • Python Essentials 2Knowing that a function named fun() resides in a module named mod, and was imported using the following statement: from mod import fun Choose the right way to invoke the fun() function:OpenProgrammingAnswers asked 2 years ago • Python Essentials 2What is the expected result of the following code? import calendar c = calendar.Calendar() for weekday in c.iterweekdays(): print(weekday, end=” “)OpenProgrammingAnswers asked 2 years ago • Python Essentials 2Which program will produce the following output: Mo Tu We Th Fr Sa SuOpenProgrammingAnswers asked 2 years ago • Python Essentials 2What is the expected result of the following code? from datetime import datetime datetime = datetime(2019, 11, 27, 11, 27, 22) print(datetime.strftime(‘%y/%B/%d %H:%M:%S’))OpenProgrammingAnswers asked 2 years ago • Python Essentials 2What is the expected result of the following code? from datetime import date date_1 = date(1992, 1, 16) date_2 = date(1991, 2, 5) print(date_1 – date_2)OpenProgrammingAnswers asked 2 years ago • Python Essentials 2What is the expected result of the following code? import os os.mkdir(‘thumbnails’) os.chdir(‘thumbnails’) sizes = [‘small’, ‘medium’, ‘large’] for size in sizes: os.mkdir(size) print(os.listdir())OpenProgrammingAnswers asked 2 years ago • Python Essentials 2What is the expected result of the following code? import os os.mkdir(‘pictures’) os.chdir(‘pictures’) os.mkdir(‘thumbnails’) os.chdir(‘thumbnails’) os.mkdir(‘tmp’) os.chdir(‘../’) print(os.getcwd())OpenProgrammingAnswers asked 2 years ago • Python Essentials 2What is the expected result of the following code? b = bytearray(3) print(b)OpenProgrammingAnswers asked 2 years ago • Python Essentials 2What is the meaning of the value represented by errno.EEXIST ?OpenProgrammingAnswers asked 2 years ago • Python Essentials 2Which of the following open modes allow you to perform read operations? (Select two answers)OpenProgrammingAnswers asked 2 years ago • Python Essentials 2What is the expected result of executing the following code? def fun(n): s = ‘+’ for i in range(n): s += s yield s for x in fun(2): print(x, end=”);OpenProgrammingAnswers asked 2 years ago • Python Essentials 2