Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
6 views
Python 2023
In this document... You can find the pyq of Masters of Operational Research (delhi University)
Uploaded by
2147 Mahesh Kumar
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save python 2023 For Later
Download
Save
Save python 2023 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
6 views
Python 2023
In this document... You can find the pyq of Masters of Operational Research (delhi University)
Uploaded by
2147 Mahesh Kumar
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save python 2023 For Later
Carousel Previous
Carousel Next
Save
Save python 2023 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 4
Search
Fullscreen
‘on paper contains four printed pages. Master of Opers Your RollNo. 22 I2WEDEtoIo al Research (MOR), SEM 1, 2023 je- Python Programming (UPC:223601105a) (N.Gx ~ Admission of 2019 nnd onwards) ‘Time: 3 Hours Write your Roll No, On the top imm . (Answer 1. Saf Explain the significance of “Sequence” ‘considered as a sequence? Stelain binary left shift and binar y Fight shift operators. Explain the same for number 29 when itis eM shifted by 2 and right shifted by 2. a Q) Course ~ MORLOS(a), Paper Tit BF Write the salient features of python programming language aN ‘What are negative indexes and why are they used? ay Jiri ‘between the following, Q. re.search () and rematch () find ( and index £4F When to use tuples in Python, Give some examples of programming situations mentioning its usefulness, @ _Ja What is the significance of NumPy library in Python? What advantages do NumPy arrays offer ‘over (nested) Python lists? @ 26 Write a program to calculate in how ‘many days a work will be completed by three persons A, 'B and C together. A, B, C take x days, y days and z days respectively to do the job alone. The formula to calculate the number of days if they work together is xyz/(xy + yz.+ xz) days where x, y,andzare given as input to the program. @ wo fo print (var) ip def findValue( vall = 1.1, val2, val3): final = (val2 + val3)/ vall print(final) findvalue() cor or runtime error with the help of examples. (2) Oo A Differentiate between syntax error, logical err = strate its usage. Aowrat is the significance of a“pass” statement? Demons Page 10f4 .3. Covi ¢ the relationship between a define a class, Programming, aN Explain your answer. Seni the output of the following code: val while var> 0; print(Current variable valuc:, var) var = var - 1 . ifvar==3: break else: ifva var = var - continue print("Good bye!") Consider the following string mySubject: mySubject = "Operational Rescarel ‘What will be the output of the following string operations? i. printGnySubject[O:ten(nys ii, print(mySubject(::2)) iii. print(mySubject{len(mySubject)-1]) print(mySubject{::-2)) print(mySubject{:3] + mySubject{3:]) vi. print(mySubject.swapcase()) jee) I What will be the output of the following Python code? while i<10: prin(("\n Continuing wit", ) continue and i== 10): prin(("\n Breaking on’, i) break print(i, end print("\n Done") ire Lambda functions? Describe. What (Explain the working ofthe following code and find the output. ?- inpul(‘Enter a non-zero value: ') while num == 0: rum = input(Enter a non-2er0 vale) num Page 2 of 4 ass and object? Write a program wnich shows how to Tow to access member Functions and how (0 create and access objects in python @) With the help of an example, differentiate between Seties and DataFrame in context of Panadas, Q) @) @) @ @ 2)pS Erptin the usage of recursion a iteration as two separate and yet connected approaches of problem solving, G) grMais a zip function? Explain itu ngan example, 0} 5. (@) Explain the following code and find the output @ lass Time: det _ init__(self, hours, minutes, seconds) selfhours = hours selfaminutes = minutes > self'seconds = seconds def add_time(self, duration): opera_hours = selfthours + duration. hours ‘opera_minutes = selfminutes + duration.minutes ‘opera_seconds = self.seconds + duration.seconds while opera_seconds >= 60: ‘opera_seconds = opera_seconds - 60 ‘opera_minutes = opera_minutes + 1 while opera_minutes >= 60: ‘opera_minutes = opera_minutes - 60 opera_hours = opera_hours + 1 print(f*Opera ends at {opera_hours);{opera_minutes}:{opera,_seconds}") def main() opera_start = Time(10, 30, 30) ‘opera_duration = Time(2, 45, 50) opera_start.add_time(opera_duration) if__name_ ‘main() (b) Write the output of the following code. (2) jport numpy as np p.array({9,11,19,1,17,5,24D print(b) bool_arr=b>9 print(bool_arr) new_arr = b{bool_arr] print(new_arr) (©) Write a program that will generate a random password, ‘The program should take input as, number of letters, symbols and’ digits one would like to keep in the password, and then the code will generate a random password each time the user inputs the arguments. @ (@ With the help of an example explain the significance ofthe_init__ method. ay Page 3 of 4(©) Following information about three students is provided in the form of dictionary of lists Create a dan tte” L23}, “Totas]350.5 400,420}, "Percenage"{70,80,84] } Teale a dataframe and write the required set of statements in order to have this information in a {abular manner, Write the output as well, w ©) Write a program to plot a bar chart in python to display the pass percentage of Department of Operational Research for five consecutive years for the given dat Year Pass Percentage 2019 98.50 2020 70.25 2021 $5.20 . 2022. 90.50 2023 96.58 @ rt Tow multiple inheritance is different from multi-level inheritance? Explain with the help of example. Q (Mite amgnu driven python program to perform various list operations, such as: @ _Aehpbend an clement G1 Insert an element 4, Append a list to the given list 48. Modify an existing element Delete an existing clemert from its position LreDelete an existing clement with a given value “pit: Sort the lis in ascending order “Aili. Sort the list in descending order (Hint: Say your list has 5 elements: [24, 3, 86, 15,7) What is the purpose of using function in python programming? Give the syntax of defining a ction in python. @ page 4 0f4
You might also like
PYTHON SEM-1
PDF
No ratings yet
PYTHON SEM-1
12 pages
PYTHON LAB MANUAL AIETM
PDF
No ratings yet
PYTHON LAB MANUAL AIETM
50 pages
Introduction To Python For Data Science 1672630478
PDF
No ratings yet
Introduction To Python For Data Science 1672630478
14 pages
Python Notes
PDF
No ratings yet
Python Notes
16 pages
Python main
PDF
No ratings yet
Python main
9 pages
Python Question Paper 1
PDF
No ratings yet
Python Question Paper 1
9 pages
CSE160-Final-18sp-key
PDF
No ratings yet
CSE160-Final-18sp-key
9 pages
PYTHON LAB MANUAL AIETM
PDF
No ratings yet
PYTHON LAB MANUAL AIETM
50 pages
CST362 Programming in Python, June 2023
PDF
No ratings yet
CST362 Programming in Python, June 2023
4 pages
Python Question and Answers
PDF
No ratings yet
Python Question and Answers
16 pages
HOA3.1
PDF
No ratings yet
HOA3.1
5 pages
PP APR-18 (Sol) (E-next.in)
PDF
No ratings yet
PP APR-18 (Sol) (E-next.in)
22 pages
Revision Basics - Python - Notes - 1
PDF
No ratings yet
Revision Basics - Python - Notes - 1
18 pages
Ashish Question Paper
PDF
No ratings yet
Ashish Question Paper
7 pages
Python Winterr
PDF
No ratings yet
Python Winterr
11 pages
2018 Nov Sample Solutions
PDF
No ratings yet
2018 Nov Sample Solutions
6 pages
group b 1
PDF
No ratings yet
group b 1
13 pages
lec_1_extended
PDF
No ratings yet
lec_1_extended
26 pages
Python 2022-23
PDF
No ratings yet
Python 2022-23
16 pages
XII CS PT1 Practice Paper
PDF
No ratings yet
XII CS PT1 Practice Paper
4 pages
python IA 2
PDF
No ratings yet
python IA 2
3 pages
Aktu Sol Bcc302 2023 24 Odd Sem
PDF
No ratings yet
Aktu Sol Bcc302 2023 24 Odd Sem
16 pages
Pythonexam
PDF
No ratings yet
Pythonexam
20 pages
21CS15IT PROBLEM SOLVING AND PYTHON PROGRAMMING QUESTIONS AND ANSWERS
PDF
No ratings yet
21CS15IT PROBLEM SOLVING AND PYTHON PROGRAMMING QUESTIONS AND ANSWERS
6 pages
21cs15it Problem Solving and Python Revision Questions and Answers (2)
PDF
No ratings yet
21cs15it Problem Solving and Python Revision Questions and Answers (2)
33 pages
PY ALL - Merged
PDF
No ratings yet
PY ALL - Merged
42 pages
PWP QB Answers
PDF
No ratings yet
PWP QB Answers
14 pages
Python 1
PDF
No ratings yet
Python 1
72 pages
XI AnnualExam CS-coimbtore
PDF
No ratings yet
XI AnnualExam CS-coimbtore
8 pages
Python Priogams
PDF
No ratings yet
Python Priogams
10 pages
Solution - Python Programming (203105211) Mid Sem
PDF
No ratings yet
Solution - Python Programming (203105211) Mid Sem
5 pages
Python 3 Functions and OOPs FP
PDF
No ratings yet
Python 3 Functions and OOPs FP
9 pages
Question Paper Python
PDF
No ratings yet
Question Paper Python
12 pages
Python AAU Final Exam Answer
PDF
No ratings yet
Python AAU Final Exam Answer
60 pages
GE - Computer Scien UyRAgNj
PDF
No ratings yet
GE - Computer Scien UyRAgNj
6 pages
Python Basics
PDF
No ratings yet
Python Basics
35 pages
Python Question Bank Unit 3,4,5 With Solution
PDF
No ratings yet
Python Question Bank Unit 3,4,5 With Solution
76 pages
Unit 5
PDF
No ratings yet
Unit 5
20 pages
Python Final
PDF
No ratings yet
Python Final
11 pages
XII CS PractisePaper 4
PDF
No ratings yet
XII CS PractisePaper 4
12 pages
749 Assignment 2
PDF
No ratings yet
749 Assignment 2
12 pages
Slides 2
PDF
No ratings yet
Slides 2
47 pages
Python Programming_223601105_12_04_2022
PDF
No ratings yet
Python Programming_223601105_12_04_2022
4 pages
Marking Scheme 2023-2024 Class:XI Subject: Computer Science (083) Section A
PDF
No ratings yet
Marking Scheme 2023-2024 Class:XI Subject: Computer Science (083) Section A
6 pages
4CSM_PP_MSE1_QP_2024_25_Solutions
PDF
No ratings yet
4CSM_PP_MSE1_QP_2024_25_Solutions
9 pages
XI CS Annual Worksheet Answer Key (2)
PDF
No ratings yet
XI CS Annual Worksheet Answer Key (2)
11 pages
This Comprehensive Python Cheat Sheet Covers Everything You Need To Know To Get Started With Python
PDF
No ratings yet
This Comprehensive Python Cheat Sheet Covers Everything You Need To Know To Get Started With Python
185 pages
Chapter-3 Data Handling
PDF
No ratings yet
Chapter-3 Data Handling
33 pages
COMPUTER SCIENCE QUESTIONS WITH ANSWERS
PDF
No ratings yet
COMPUTER SCIENCE QUESTIONS WITH ANSWERS
8 pages
Python Practical question
PDF
No ratings yet
Python Practical question
21 pages
Informatics Practices (Part-2)
PDF
No ratings yet
Informatics Practices (Part-2)
28 pages
Python Model Soultion 2
PDF
0% (1)
Python Model Soultion 2
12 pages
Python Practical File
PDF
No ratings yet
Python Practical File
19 pages
Class 12 CS Revision Tour Notes PDF by Nitin Paliwal (2)
PDF
No ratings yet
Class 12 CS Revision Tour Notes PDF by Nitin Paliwal (2)
11 pages
Python File Mca
PDF
No ratings yet
Python File Mca
35 pages
Python Programming Laboratory Manual & Record: Assistant Professor Maya Group of Colleges Dehradun
PDF
No ratings yet
Python Programming Laboratory Manual & Record: Assistant Professor Maya Group of Colleges Dehradun
32 pages