PYTHON PROGRAMMING - BIET

2y ago
33 Views
6 Downloads
406.93 KB
17 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Brady Himes
Transcription

PYTHON PROGRAMMINGSubject Code:CS721PERegulations : R16 - JNTUHClass: IV Year B.Tech CSE I SemesterDepartment of Computer Science and EngineeringBharat Institute of Engineering and TechnologyIbrahimpatnam-501510,Hyderabad

PYTHON PROGRAMMING (CS721PE)COURSE PLANNERI.COURSE OVERVIEW:Python Programming is intended for software engineers, systems analysts, programmanagers and user support personnel who wish to learn the Python programming language. ThisPython for beginners training course leads the students from the basics of writing and runningPython scripts to more advanced features such as file operations, regular expressions, working withbinary data, and using the extensive functionality of Python modules. Extra emphasis is placed onfeatures unique to Python, such as tuples, array slices, and output formatting.II.PRE-REQUISITES:Experience with a high level language (C/C , Java, MATLAB) is suggested. Prior knowledge ofa scripting language (Perl, UNIX/Linux shells) and Object-Oriented concepts is helpful but notmandatory.III. COURSE OBJECTIVIES: To be able to introduce core programming basics and program design with functions usingPython programming language. To understand a range of Object-Oriented Programming, as well as in-depth data andinformation processing techniques. To understand the high-performance programs designed to strengthen the practicalexpertise.Course PurposeThis course PYTHON PROGRAMMING is an essential part of any Computer-Scienceeducation. To master the fundamentals of writing Python scripts, learn core Python scriptingelements such as variables and flow control structures, discover how to work with lists andsequence data, write Python functions to facilitate code reuse ,use Python to read and write files,make their code robust by handling errors and exceptions properly, work with the Python standardlibrary, explore Python's object-oriented features , search text using regular expressions and finallyworking with GUI (Graphical User Interfaces)IV.COURSE OUTCOMES:S.Bloom TaxmonyCourse Outcomes (CO)No.After completing this course the student must demonstrate the knowledge and ability to:Examine Python syntax and semanticsL4 AnalyzeCO1 and be fluent in the use of Python flowcontrol and functions.Demonstrate proficiency in handlingL3 ApplyCO2Strings and File Systems.Create, run and manipulate PythonL6 CreatePrograms using core data structures likeCO3Lists, Dictionaries and use RegularExpressions.Interpret the concepts of ObjectL3 ApplyCO4 Oriented Programming as used inPython.Implement exemplary applicationsL6 CreateCO5related to Network Programming, WebIV CSE B.TECH I SEMPage 42

Services and Databases in Python.V. How Program Outcomes are Assessed:Program Outcomes (PO)PO1PO2PO3PO4PO5PO6PO7PO8PO9PO10Engineering knowledge: Apply the knowledge ofmathematics, science, engineering fundamentals, and anengineering specialization to the solution of complexengineering problems.Problem analysis: Identify, formulate, review researchliterature, and analyze complex engineering problemsreaching substantiated conclusions using first principles ofmathematics, natural sciences, and engineering sciences.Design/development of solutions: Design solutions forcomplex engineering problems and design systemcomponents or processes that meet the specified needs withappropriate consideration for the public health and safety, andthe cultural, societal, and environmental considerations.Conduct investigations of complex problems: Useresearch-based knowledge and research methods includingdesign of experiments, analysis and interpretation of data,and synthesis of the information to provide valid conclusions.Modern tool usage: Create, select, and apply appropriatetechniques, resources, and modern engineering and IT toolsincluding prediction and modeling to complex engineeringactivities with an understanding of the limitations.The engineer and society: Apply reasoning informed by thecontextual knowledge to assess societal, health, safety, legaland cultural issues and the consequent responsibilitiesrelevant to the professional engineering practice.Environment and sustainability: Understand the impact ofthe professional engineering solutions in societal andenvironmental contexts, and demonstrate the knowledge of,and need for sustainable development.Ethics: Apply ethical principles and commit to professionalethics and responsibilities and norms of the engineeringpractice.Individual and team work: Function effectively as anindividual, and as a member or leader in diverse teams, and inmultidisciplinary settings.Communication: Communicate effectively on complexengineering activities with the engineering community andwith society at large, such as, being able to comprehend andwrite effective reports and design documentation, makeeffective presentations, and give and receive clearIV CSE B.TECH I SEMLevelProficiencyassessed by2Assignments,Tutorials,Mock Mock Tests3Assignments,Tutorials,Mock Tests2Assignments,Tutorials,Mock Tests3Assignments,Tutorials,Mock Tests--------Page 43

Program Outcomes (PO)LevelProficiencyassessed byinstructions.Project management and finance: Demonstrate knowledgeand understanding of the engineering and managementAssignments,PO11 principles and apply these to one‟s own work, as a member2Tutorials,and leader in a team, to manage projects and inMock Testsmultidisciplinary environments.Life-long learning: Recognize the need for, and have thePO12 preparation and ability to engage in independent and life-longlearning in the broadest context of technological change. End-of-course surveys (Quarterly). Instructor evaluation reports (Quarterly). Department performance report (Quarterly). Student exit survey (Yearly). Alumni survey (Yearly). Alumni Advisory Board (Once or twice yearly). Student Advisory Committee (Once or twice yearly).VI.HOW PROGRAM SPECIFIC OUTCOMES ARE ASSESSED:Program Specific Outcomes (PSO)LevelProficiency assessed byFoundation of mathematical concepts: To usemathematical methodologies to crack problem usingAssignments,PSO12suitable mathematical analysis, data structure andTutorials, Mock Testssuitable algorithm.Foundation of Computer System: The ability tointerpret the fundamental concepts and methodologyAssignments,PSO2 of computer systems. Students can understand the2Tutorialsfunctionality of hardware and software aspects ofcomputer systems.Foundations of Software development: Theability to grasp the software development lifecycleand methodologies of software systems. PossessAssignments,PSO3 competent skills and knowledge of software design3Tutorials, Mock Testsprocess. Familiarity and practical proficiency with abroad area of programming concepts and providenew ideas and innovations towards research.1:Slight2: Moderate3: Substantial(Low)(Medium)- : None(High)VII. SYLLABUS:UNIT - IPython Basics, Objects- Python Objects, Standard Types, Other Built-in Types, Internal Types,Standard Type Operators, Standard Type Built-in Functions, Categorizing the Standard Types,Unsupported TypesIV CSE B.TECH I SEMPage 44

Learning ObjectivesUNIT-IIntroduction to pythonExplain python programmingprogrammingintroductionDefine basics in python112Python BasicsUnderstand objects in python3Objects- Python ObjectsIV CSE B.TECH I SEMReferencesTopic to be coveredTeachingmethodologyWeek NoSNONumbers - Introduction to Numbers, Integers, Floating Point Real Numbers, Complex Numbers,Operators, Built-in Functions, Related ModulesSequences - Strings, Lists, and Tuples, Mapping and Set TypesUNIT - IIFILES: File Objects, File Built-in Function [ open() ], File Built-in Methods, File Built-inAttributes, Standard Files, Command-line Arguments, File System, File Execution, PersistentStorage Modules, Related ModulesExceptions: Exceptions in Python, Detecting and Handling Exceptions, Context Management,*Exceptions as Strings, Raising Exceptions, Assertions, Standard Exceptions, *CreatingExceptions, Why Exceptions (Now)?, Why Exceptions at All?, Exceptions and the sys Module,Related ModulesModules: Modules and Files, Namespaces, Importing Modules, Importing Module Attributes,Module Built-in Functions, Packages, Other Features of ModulesUNIT - IIIRegular Expressions: Introduction, Special Symbols and Characters, Res and PythonMultithreaded Programming: Introduction, Threads and Processes, Python, Threads, and theGlobal Interpreter Lock, Thread Module, Threading Module, Related ModulesUNIT - IVGUI Programming: Introduction, Tkinter and Python Programming, Brief Tour of Other GUIs,Related Modules and Other GUIsWEB Programming: Introduction, Wed Surfing with Python, Creating Simple Web Clients,Advanced Web Clients, CGI-Helping Servers Process Client Data, Building CGI ApplicationAdvanced CGI, Web (HTTP) ServersUNIT – VDatabase Programming: Introduction, Python Database Application Programmer‟s Interface(DB-API), Object Relational Managers (ORMs), Related ModulesTextbook1. Core Python Programming, Wesley J. Chun, Second Edition, Pearson.VIII. LESSON PLAN:Chalk andTalkChalk andTalk &PPTChalk andTalkT1Page 45

Illustrate standard data types4567289101112133141516174181920Chalk andStandard TypesTalkOther Built-in Types,Define internal typesChalk andInternal TypesTalkStandard Type Operators,Explain Standard TypeChalk andStandard Type Built-inOperators, Standard Type Built- TalkFunctionsin FunctionsCategorizing the StandardCategorizing the StandardChalk andTypes,Unsupported TypesTypes,Unsupported TypesTalkNumbers - Introduction toExplain Numbers , IntegersChalk andNumbers, IntegersTalkFloating Point RealDiscuss Floating Point RealChalk andNumbers, Complex Numbers Numbers, Complex NumbersTalkOperators, Built-inDiscuss Operators, Built-inChalk andFunctions, Related Modules Functions, Related ModulesTalkSequences - StringsExplain Sequences – StringsChalk andTalk&PPTLists, and TuplesDescribe Lists, and TuplesChalk andTalk&PPTMapping and Set TypesUnderstand Mapping and SetChalk andTypesTalk&PPTUNIT-IIChalk andUnderstand FILES: FileTalk&FILES: File ObjectsObjectsPPTChalk andFile Built-in Function [Describe File Built-in Function Talk&open() ][ open() ]PPTChalk andTalk&File Built-in MethodsDefine File Built-in MethodsPPTChalk andFile Built-in Attributes,Explain File Built-in Attributes, Talk&Standard FilesStandard FilesPPTChalk andAnalyze Command-lineTalk&Command-line ArgumentsArgumentsPPTChalk andDescribe File System, FileFile System, File ExecutionTalk&ExecutionPPTDistinguish Persistent StorageChalk andPersistent Storage ModulesModulesTalk&IV CSE B.TECH I SEMT1Page 46

212223242552627Related Modules Exceptions:Exceptions in Python,Detecting and HandlingExceptionsContext Management,*Exceptions as Strings,Raising ExceptionsAssertions, StandardExceptions*Creating Exceptions, WhyExceptions? Why Exceptionsat All?Context Management,*Exceptions as Strings, RaisingExceptionsAssertions, StandardExceptions*Creating Exceptions, WhyExceptions? Why Exceptions atAll?BRIDGE CLASS 1Exceptions and the sysModuleRelated Modules Modules:Modules and FilesNamespaces, ImportingModules28293031MOCK TEST IRelated Modules Exceptions:Exceptions in Python,Detecting and HandlingExceptions632Importing Module Attributes36BRIDGE CLASS 2Module Built-in Functions,Packages, Other Features ofModulesUNIT IIIRegular Expressions:IntroductionSpecial Symbols andCharactersRes and PythonMultithreaded Programming:Introduction37Threads and Processes38BRIDGE CLASS 333343578IV CSE B.TECH I SEMPPTChalk andTalk&PPTChalk andTalkChalk andTalkChalk andTalkChalk andTalkChalk andTalkChalk andTalkDefine Exceptions and the sysChalk andModuleTalkUnderstand Related ModulesChalk andModules: Modules and FilesTalkExaplin Namespaces, Importing Chalk andModulesTalkUnderstand Importing ModuleChalk andAttributesTalkChalk andTalkApply Module Built-inChalk andFunctions, Packages, OtherTalkFeatures of ModulesExplain Regular Expressions:IntroductionUnderstand Special Symbolsand CharactersExaplain Res and PythonMultithreaded Programming:IntroductionDistinguish between Threadsand ProcessesChalk andTalkChalk andTalkChalk andTalkT1Chalk andTalkChalk andTalkMID 1 EXAMSPage 47

39404194243PythonThreads and the GlobalInterpreter LockExaplin PythonUnderstand Threads and theGlobal Interpreter LockThread ModuleThreading Module, RelatedModulesApply Thread ModuleDiscuss Threading Module,Related Modules47BRIDGE CLASS 4UNIT IVGUI Programming:IntroductionGUI Programming:IntroductionTkinter and PythonProgrammingTkinter and PythonProgramming48Brief Tour of Other GUIs49BRIDGE CLASS 55052Brief Tour of Other GUIsRelated Modules and OtherGUIs WEB Programming:IntroductionWEB Programming:Introduction53WEB Programming:54Wed Surfing with Python55BRIDGE CLASS 6Creating Simple Web Clients Apply Creating Simple WebClientsCreating Simple Web Clients Apply Creating Simple WebClientsAdvanced Web ClientsElaborate Advanced WebClientsCGI-Helping ServersExplain CGI-Helping ServersProcess Client DataProcess Client Data444510461151561257585913IV CSE B.TECH I SEMChalk andTalkChalk andTalkChalk andTalkChalk andTalkChalk andTalkExplain GUI Programming:IntroductionExplain GUI Programming:IntroductionUnderstand Tkinter and PythonProgrammingUnderstand Tkinter and PythonProgrammingDefine Brief Tour of OtherGUIsChalk andTalk,PPTChalk andTalk,PPTChalk andTalk,PPTChalk andTalk,PPTChalk andTalk,PPTChalk andTalk,PPTDefine Brief Tour of OtherGUIsUnderstand Related Modulesand Other GUIs WEBProgramming: IntroductionDescribe WEB Programming:IntroductionChalk andTalk,PPTChalk andTalk,PPTDescribe WEB Programming:Discuss Wed Surfing withPythonT1Chalk andTalk,PPTChalk andTalk,PPTChalk andTalk,PPTChalk andTalk,PPTChalk andTalk,PPTChalk andTalk,PPTChalk andTalk,PPTChalk andTalk,PPTPage 48

MOCK TEST II6061Building CGI ApplicationAdvanced CGIWeb (HTTP) ServersBuilding CGI ApplicationAdvanced CGIWeb (HTTP) ServersRevisionRevision6263Chalk andTalk,PPTChalk andTalk,PPTChalk andTalk,PPTChalk andTalk,PPTUNIT V646566146768697015717273747576Chalk andTalk,PPTDatabaseProgramming: ExplainDatabase Chalk andIntroduction,Programming: Introduction,Talk,PPTChalk andDatabase ProgrammingExaplin Database Programming Talk,PPTPython DatabaseDiscuss Python DatabaseChalk andApplication Programmer‟sApplication Programmer‟sTalk,PPTInterfaceInterfaceChalk andTalk,PPTBRIDGE CLASS 8Python DatabaseDefine Python DatabaseChalk andApplication Programmer‟sApplication Programmer‟sTalk,PPTInterfaceInterfacePython Databasedefine Python DatabaseChalk andApplication Programmer‟sApplication Programmer‟sTalk,PPTInterfaceInterfaceChalk and(DB-API)Understand (DB-API)Talk,PPTChalk and(DB-API)Undersatnd (DB-API)Talk,PPTObject Relational ManagersExaplain Object RelationalChalk and(ORMs)Managers (ORMs)Talk,PPTObject Relational Managers Explain Object RelationalChalk and(ORMs)Managers (ORMs)Talk,PPTChalk andRelated ModulesUnderstand Related ModulesTalk,PPTChalk andRelated ModulesUnderstand Related ModulesTalk,PPTChalk andTalk,PPTBRIDGE CLASS 9Chalk andTalk,PPTBRIDGE CLASS 10BRIDGE CLASS 7167778T1MID II17IV CSE B.TECH I SEMPage 49

Textbook1. Core Python Programming, Wesley J. Chun, Second Edition, Pearson.IX.MAPPING COURSE OUTCOMES LEADING TO THE ACHIEVEMENT PROGRAMOUTCOMES AND PROGRAM SPECIFIC OUTCOMES:Program SpecificOutcomes (PSO)CourseOutcomesProgram Outcomes 2322-----1121X. QUESTION BANKDESCRIPTIVE QUESTIONS:UNIT-IShort Answer QuestionsS.NOQUESTION1. Explain the difference between compiled and interpreted languages2. What are mutable and immutable types?3. What happens if a semicolon (;) is placed at the end of a Pythondictionary in Pythonstatement4. Define5. Explain the features of tuple data structureLong Answer 2: UNDERSTANDL1: REMEMBERL1: REMEMBERL1: REMEMBERL2: mesCO11. Explain about the need for learning python programming and its L2: UNDERSTANDimportance.2. Write in brief about the applications of Python. Give examples.3. Explain the following operators in python with appropriate examplesL2: UNDERSTANDL2: UNDERSTANDi. aboutLogicaloperatorsmethodsin Lists of Python with appropriate examples4. ExplainL2: UNDERSTANDii.Relational operatoriii. WriteArithmetica)a python operatorprogram to describe different ways of deletingCO1CO1CO3an element from the given ListIV CSE B.TECH I SEMPage 50

5. Give a comparison between lists, tuples, dictionaries and sets.L5: EVALUATECO3UNIT-2Short Answer QuestionsS.NOQUESTION1. Define File Objects?2. What is meant Exceptions as Strings?3. Define File Built-in Function [ open() ]?4. Can a Python function return multiple values? If yes,how it works?5. List out different File Built-in MethodsLong Answer QuestionsS.NOQUESTION1. What type of parameter passing is used in Python?Pythonprogramoverloads operator, to2. WriteJustifyayouranswerwith thatsampleprograms.add two objects of a class.3. What are the two ways of importing a module?a) Howintobriefcreate,raiseand handle user definedaboutPackages?4. ExplainWhich oneis morebeneficial?Explain.exceptions in Python.5. Explain how to implement inheritance in Python.a) How to handle an exception usingUNIT-3try exceptblock?Explainwiththehelpofaprogram.Short Answer QuestionsS.NOQUESTION1. Describe the terms Threads in python?2. Describe Special Symbols and Characters?3. Describe Terms Processes in python?4. Define Threading Module?5. Define Regular Expressions?Long Answer QuestionsS.NOQUESTION1.2.BLOOMSTaxonomyL2: UNDERSTANDCourseOutcomesCO2CO2CO2CO2L2: UNDERSTANDCO2BLOOMSTaxonomyL2: UNDERSTANDCourseOutcomesCO2CO2L2: UNDERSTANDL2: UNDERSTANDL2: UNDERSTANDCO2CO2CO2BLOOMSTaxonomyCourseOutcomesL2: UNDERSTANDL2: UNDERSTANDL2: UNDERSTANDL2: UNDERSTANDL2: mesL1: REMEMBERL1: REMEMBERL1: REMEMBERL2: UNDERSTANDExplain the methods that are used to synchronize L2: UNDERSTANDthreads?What are regular expressions? How to find whetherL2: UNDERSTANDan email id entered by user is valid or not usingPython„re‟ module.IV CSE B.TECH I SEMCO3CO3Page 51

What is multithreading? Discuss about starting a new L2: UNDERSTANDthread.Explain in detail about Global Interpreter Lock with L2: UNDERSTANDexample?CO3Explain in detail about Res and PythonMultithreaded Programming?UNIT-4Short Answer QuestionsS.NOQUESTIONL2: UNDERSTANDCO3BLOOMSTaxonomyCourseOutcomes1. Describe Building CGI Application.2. Define CGI-Helping Servers Process Client Data.3. What is tkinter TK ()?4. What is the best GUI for Python.5. How tkinter applications can be freezed?Long Answer QuestionsS.NOQUESTIONL2: UNDERSTANDL2: UNDERSTANDL2: UNDERSTANDL2: UNDERSTANDL2: mes3.4.5.1.2.3.4.5.Explain about Radio button widget in tkinter. How tocreate two radio button sets (one for gender andanother for Indian or not) on the same canvas.?CO3CO4L2: UNDERSTANDWrite a Python program that creates a GUI with atextbox, Ok button and Quit button. On clicking Ok, L2: UNDERSTANDthe text entered in textbox is to be printed in Pythonshell;oninclickingQuit, Webthe programterminate. L2: UNDERSTANDExplaindetail about(HTTP)shouldServers.Write a program for basic web browser using Tkinterwhich should have a Text widget where the user canL3: APPLYenter a URL and a Canvas to display the contents ofthe page.Explain with an example about Wed Surfing withL2: UNDERSTANDPython?CO4CO4CO4CO4UNIT-5Short Answer QuestionsS.NOQUESTION1.2.3.4.5.Define usage of following Type Object.What is meant by frameworks?i. DatabasesTime(hr,sec) AdaptersDefineandmin,Pythonii. is databaseDate(yr,mo, dy)Whatschema?What is the use of cursor.getrowid() method .IV CSE B.TECH I SEMBLOOMSTaxonomyCourseOutcomesL1: REMEMBERL2: UNDERSTANDL1: REMEMBERL2: UNDERSTANDL2: UNDERSTANDCO5CO5CO5CO5CO5Page 52

Long Answer 2: UNDERSTANDWrite the syntax to open a database in python?CO5Write the syntax to execute database queries toCO5L2: UNDERSTANDperform the following operations.L2: UNDERSTAND3. Explain in detail about Object Relational Managers?CO5i. aboutCreatePython Database Application4. DiscussCO5L2: UNDERSTANDii. Programmer'sUpdate Interfaceiii. followingInsert connection objects.L2: UNDERSTAND5. ExplainCO5i.commit()ii.rollback()iii. QUESTIONScursor()OBJECTIVEiv.close()UNIT 11. What Is The Default Return Value For A Function That Does Not Return Any Value Explicitly?A. NoneB. intC. doubleD. public E. null2. Which Of The Following Items Are Present In The Function Header?A. function name B. function name and parameter listC. parameter listD. return value3.What Will Be The Output Of The Following Code Snippet?a [1,2,3,4,5,6,7,8,9]print(a[::2])A. [1,2]B. [8,9]C. [1,3,5,7,9]D. [1,2,3]4. What Will Be The Output Of The Following Code Snippet?a [1,2,3,4,5]print(a[3:0:-1])A. Syntax error. [4, 3, 2]C. [4, 3]D. [4, 3, 2, 1]5. What Will Be The Output Of The Following Code?class Test:def init (self, s):self.s sdef print(self):print(s)a Test("Python Class")a.print()A. The program gives an error because there is no constructor for class Test.B. Signature for the print method is incorrect, so an error is thrown.C. The correct output is .D. The above code will execute correctly on changing print(s) to print(self.s).Q-6What Will Be The Output Of The Following Code?class Test:def init (self, s):self.s sdef print(self):print(self.s)1.2.IV CSE B.TECH I SEMPage 53

msg Test()msg.print()A. The program has an error because class Test does not have a constructor.B. The above code produces an error because the definition of print(s) does not include .C. It executes successfully but prints nothing.D. The program has an error because of the constructor call is made without anargument.Fill in the blanks:7 . Wagner–Fischer is a algorithm. (Dynamic programming)8. Wagner–Fischer algorithm is used to find (Edit distance between two strings)9. What is the edit distance between the strings “abcd” and “acbd” when the allowed operations areinsertion, deletion and substitution? (2)10.What will be the output? (2, 4)1. t (1,2,4,3)2. t[1:3]UNIT 21.To open a file c:\scores.txt for reading, we usea) infile open(“c:\scores.txt”, “r”)b) infile open(“c:\\scores.txt”, “r”)c) infile open(file “c:\scores.txt”, “r”)d) infile open(file “c:\\scores.txt”, “r”)2.What is the output?1. f None2. for i in range (5):3. with open("data.txt", "w") as f:4.if i 2:5.break6. print(f.closed)a)Trueb)Falsec)Noned) Error3.Can one block of except statements handle multiple exception?a) yes, like except TypeError, SyntaxError [, ].b) yes, like except [TypeError, SyntaxError].c) nod) none of the mentioned4.Is the following code valid?try:# Do somethingexcept:# Do somethingfinally:# Do somethinga) no, there is no such thing as finallyb) no, finally cannot be used with exceptc) no, finally must come before exceptd) yes5. All modular designs are because of a top-down design process? True or False?a) Trueb) FalseFill in the blanks:6. The readlines() method returnsa list ofAnswer: LinesIV CSE B.TECH I SEMPage 54

7.Program code making use of a given module is called a of the module. Answer:Client8. is a string literal denoted by triple quotes for providing the specifications of certainprogram elements.Answer:Docstring9. exceptions are raised as a result of an error in opening a particularfile. Answer: IOError10.Methods of a class that provide access to private members of the class are called as andAnswer:getters/settersUNIT III1. Which module in Python supports regular expressions?a) re b) regex c) pyregexd) none of the mentioned2. Which of the following creates a pattern object?a) re.create(str)b) re.regex(str)c) re.compile(str)d) re.assemble(str)3. What does the function re.match do?a) matches a pattern at the start of the string b) matches a pattern at any position in the stringc) such a function does not existd) none of the mentioned4. Which of the following functions clears the regular expression cache?a) re.sub()b) re.pos()c) re.purge()d) re.subn()5 What is the output of the line of code shown below?re.split('\W ', 'Hello, hello, hello.')a) [„Hello‟, „hello‟, „hello.‟]b) [„Hello, „hello‟, „hello‟]c) [„Hello‟, „hello‟, „hello‟, „.‟]d) [„Hello‟, „hello‟, „hello‟, ”]Fill in the blanks:6. The character Dot (that is, „.‟) in the default mode, matches any character other than(newline)7.The expression a{5} will match characters with the previous regularexpression.( exactly 5)8. functions matches a pattern at any position in the string(re.search)9. In the functions re.search.start(group) and re.search.end(group), if the argument groups notspecified, it defaults to (Zero)10. functions does not accept any argument(re.purge)UNIT IV1. How do you create a window?a) window newWindow() b) window Window()c) window Frame()d) window Tk()2. How do you create a frame?a) frame newWindow()b) frame Window()c) frame Frame()d) frame Tk()3. How do you create an event loop?a) window.loop() b) window.main() c) window.mainloop() d) window.eventloop()4. How do you create a canvas under parent frame1 with background color white and foregroungcolor green?a) Canvas(frame1, bg "white", fg "green")b) Canvas(frame1, bg "white", fg "green", command processEvent)c) Canvas(frame1, bg "white", command processEvent)d) Canvas(frame1, fg "green", command processEvent)IV CSE B.TECH I SEMPage 55

5. To display an error dialog named "Variable is not assigned", usea) tkinter.messagebox.showinfo("showinfo", "Variable is not assigned")b) tkinter.messagebox.showwarning("showwarning", "Variable is not assigned")c) tkinter.messagebox.showerror("showerror", "Variable is not assigned")d) tkinter.messagebox.askyesno("ashyesno", "Variable is not assigned")Fill in the blanks:6. grid() method7. w Canvas( ) Answer : master, option value8. Listbox) Answer : offers a list to the user from which the user can accept anynumber of options.9. CGI stands for10. Module used for GUI and web programmingUNIT V1. Which method is used to retrieve the executed database function or stored procedure result inPythona)cursor.stored results()b)cursor.get results()c)cursor.fetch results()2. Which method of cursor class is used to get the number of rows affected after any of theinsert/update/delete database operation executed from Pythona) cursor.rowcountb)cursor.getaffectedcount c)cursor.rowscount3. Which method is used to Commit pending transaction to the database in datory arguments required to connect any database from Pythona)Username, Password, Hostname, Database Name, Port.b)Username, Password, Hostnamec) Username, Password, Hostname, Database Name5.Exception raised when the relational integrity of the database is affected in ityViolationErrorFill in the blanks:6.ORMs stands (Object relation models)7.DB-API stands for8.Relational databases are the most widely used type of database, storing information as tablescontaining a number of rows.(TRUE/FALSE)9. method of cursor class is used to fetch limited rows from the table(cursor.fetchmany(SIZE))10 method of cursor class is used to get the number of rows affected after any of theinsert/update/delete database operation executed from Python (cursor.rowcount)GATE QUESTIONSNot omXII.EXPERT DETAILS1. Wesley J. ChunIV CSE B.TECH I SEMPage 56

2. https://www.innoappstech.com/?utm medium nancy&utm source top python programmers / quora3. https://www.valuecoders.com/?utm medium nancy&utm source top python programmers / quora4. https://www.pixelcrayons.com/?utm medium nancy&utm source top python programmers / quora5. Guido van RossumXIII.JOURNALS1.Programming with Python DOI: 10.1109/MITP.2005.120Publisher: IEEE2. Python PowerDOI: 10.1109/MCSE.2014.26Publisher: IEEE3. Exploration of teaching method of Python Programming based on the case of technicalproblemDOI: 10.1109/ICCSE.2017.8085563 Publisher: IEEEXIV.LIST OF TOPICS FOR STUDENTS‟ SEMINARS1.Python Basics2.Lists, and Tuples3. FILES:4. Exceptions in Python, Detecting and Handling Exceptions5. GUI Programming6. WEB Programming:7. Creating Simple Web Clients8.Python Database Application Programmer‟s InterfaceXV.CASE STUDIES / PROJECTSDice Rolling SimulatorGuess the NumberText Based Adventure GameMad Libs generatorHangmanIV CSE B.TECH I SEMPage 57

PYTHON PROGRAMMING (CS721PE) COURSE PLANNER I.COURSE OVERVIEW: Python Programming is intended for software engineers, systems analysts, program managers and user support personnel who wish to learn the Python programming language. This Python for beginners training course

Related Documents:

Python Programming for the Absolute Beginner Second Edition. CONTENTS CHAPTER 1 GETTING STARTED: THE GAME OVER PROGRAM 1 Examining the Game Over Program 2 Introducing Python 3 Python Is Easy to Use 3 Python Is Powerful 3 Python Is Object Oriented 4 Python Is a "Glue" Language 4 Python Runs Everywhere 4 Python Has a Strong Community 4 Python Is Free and Open Source 5 Setting Up Python on .

Python 2 versus Python 3 - the great debate Installing Python Setting up the Python interpreter About virtualenv Your first virtual environment Your friend, the console How you can run a Python program Running Python scripts Running the Python interactive shell Running Python as a service Running Python as a GUI application How is Python code .

Python is readable 5 Python is complete—"batteries included" 6 Python is cross-platform 6 Python is free 6 1.3 What Python doesn't do as well 7 Python is not the fastest language 7 Python doesn't have the most libraries 8 Python doesn't check variable types at compile time 8 1.4 Why learn Python 3? 8 1.5 Summary 9

site "Python 2.x is legacy, Python 3.x is the present and future of the language". In addition, "Python 3 eliminates many quirks that can unnecessarily trip up beginning programmers". However, note that Python 2 is currently still rather widely used. Python 2 and 3 are about 90% similar. Hence if you learn Python 3, you will likely

There are currently two versions of Python in use; Python 2 and Python 3. Python 3 is not backward compatible with Python 2. A lot of the imported modules were only available in Python 2 for quite some time, leading to a slow adoption of Python 3. However, this not really an issue anymore. Support for Python 2 will end in 2020.

Python Programming - This is a textbook in Python Programming with lots of Practical Examples and Exercises. You will learn the necessary foundation for basic programming with focus on Python. Python for Science and Engineering - This is a textbook in Python Programming with lots of Examples, Exercises, and Practical Applications

CR ASH COURSE PY THON CR ASH COURSE 2ND EDITION ERIC MATTHES SHELVE IN: PROGRAMMING LANGUAGES/ PYTHON 39.95 ( 53.95 CDN) LEARN PYTHON— FAST! COVERS PYTHON 3.X Python Crash Course is the world's best-selling guide to the Python programming language. This fast-paced, thorough introduction to programming with Python will

In Abrasive Jet Machining (AJM), abrasive particles are made to impinge on the work material at a high velocity. The jet of abrasive particles is carried by carrier gas or air. High velocity stream of abrasive is generated by converting the pressure energy of the carrier gas or air to its kinetic energy and hence high velocity jet. Nozzle directs the abrasive jet in a controlled manner onto .