Nội dung text Python Programming Fundamentals MTE.pdf
Mid 1eT imn Technology FacultyofComputer Science& Even Semester March 2025 Department of Intormation Technology B.Tech.- Information Teehnology Course Code: INT2242 Course: Python Programnming Fundamentals (PE-1) Time: 1.5 hrs. Instructions:AlIl questionsare compulsory. Missing data, ifany,mav be assumed suitably. Caleulator is allowed SECTION A (Memory Based Questions) S. No. a. What will be the output of the following code? a7 b=2 C=4 QAI print(a>b>c) b. What will be the output ofthe following code? sl=[1,2. 3} s2-(3.4,5) print (s1 As2) ujtoppers.in What will the output of the code blocks below be? x["Hello"."Python", "is". "fun"),"to", "learn"] print(x[1][)) Q A2 print(x[1:][0|[2)) print(x[:2[]0) print(x[1][:-1) You have a few Python variables produet ="Smartphone" that deseribe a smartphone: brand ="Samsung" model ="GalaxyS24" price =8000 discount =10#in percentage QA3 final price price (price * discount/ 100) Using these variables, create the following string to display the following output using the string formatting or formnat method. Buy the latest Samsung Galaxy S24 Smartphone for just 28000!Limited offer: Get 10% ofr. now available for 72001" SECTION B(Concept Based Questions) Completethe following code: List1=[] Q BI #Write code here to get list elements from user Semester: IV Max. Marks: 30 Marks CO 2*1-2 INT2242.1 40.5=2 INT2242.2 INT2242.1 1+2+1=4 INT224