Partial preview of the text
Download Electronics digital and more Exams Digital Electronics in PDF only on Docsity!
- Abelian Rave Wu Computer Programming First Semester Examinations July 2021 + Year IV — Electrical and Electronic Engineering Time Allowed: 1.5 Hours Answer ANY THREE (3) questions in SECTION F (All questions carry equal marks) i SECTION | + 1. Distinguish between a list and an array. b, Distinguish between the list data type and the tuple data type. ¢. Given variables m and n, use string formatting to print out the values of m and n and their product, For example, if m = 8 and » = 5 your statement should print 8.x 5 = 40. 2. a. Give the generic form of a class in Python C : ©. Write a short note on “what is an algovithm?”. Plesse_ ‘ ¢, What are the main characteristics of algorithms? ~ f he) 3. a, Distinguish between low-level programming lang languages, give examples. -s and high-level programming b. Explain what is meant by “Python is an interpreted kmeuage” ¢. When is a vatiable considered to be a loce! variable? \ 4.8, Rewrite these Python cade snippets to remove the error in them (3a (i). a+b=3 Gil). a=0=b b, Highlight the steps in the Program Development Cycle. c. Whar is the Jength of list whose lest item has an index of 5? 5.a, Identify the errors in this Python code: @. Gi). ~ Gil). # Here is the main function. _ def Algebra Class() print("John’s GPA is" +3) def my_function() avg-grade=gradeSum/noStudent print("Helio, World!") print(avg-grade) My_Function() Scanned with CamScanner