Premium Essay

Cs 1101 Unit 7

Submitted By
Words 399
Pages 2
Written Assignment Unit 7: Dictionaries and Tuples University of the People CS 1101: Programming Fundamentals Dr. Clifford Kettemborough, Instructor March 17th 2024.

Create a Python function that will invert the original dictionary. This function will take the original dictionary as input, iterate through each student and their courses, and create a new dictionary with courses as keys and students as values. Each key has three different values associated with it.

Here is the Python function.

Python def invert_dictionary(input_dict): inverted_dict = for student, courses in input_dict.items(): for course in courses: if course not in inverted_dict: inverted_dict[course] = [student] else: inverted_dict[course].append(student) return …show more content…
The invert_dictionary function takes the original dictionary as input. 2. What is the difference between a'smart' and a'smart'? It iterates through each student in the original dictionary and their courses. 3. What is the difference between a'smart' and a'smart'? For each course, it checks if the course is already a key in the dictionary. If not, it creates a new key and assigns the student as the value. 4. What is the difference between a.. If the course already exists in the dictionary, the student is appended to the list of values associated with that key. 5. What is the difference between a'smart' and a'smart'? The function returns the inverted dictionary with courses as keys and students as …show more content…
This code successfully creates an inverted dictionary where courses are keys and students enrolled in each course are values. This meets the requirement of having a dictionary with the courses as keys and students enrolled in each course as values, with each key having three different values.

References

Downey, A. (2015). The 'Secondary' of the 'Secondary' of the 'Secondary' of Think Python: How to think like a computer scientist. Green Tea Press. https://greenteapress.com/thinkpython2/thinkpython2.pdf

Iqbal, W. (2020, July 27). How to install Python 3.8.5 on Windows 10 [2020] - YouTube. Video. The. YouTube. https://www.youtube.com/watch?v=yiCUmJon -5

Similar Documents

Free Essay

Nit-Silchar B.Tech Syllabus

...NATIONAL INSTITUTE OF TECHNOLOGY SILCHAR Bachelor of Technology Programmes amï´>r¶ JH$s g§ñWmZ, m¡Úmo{ à VO o pñ Vw dZ m dY r V ‘ ñ Syllabi and Regulations for Undergraduate PROGRAMME OF STUDY (wef 2012 entry batch) Ma {gb Course Structure for B.Tech (4years, 8 Semester Course) Civil Engineering ( to be applicable from 2012 entry batch onwards) Course No CH-1101 /PH-1101 EE-1101 MA-1101 CE-1101 HS-1101 CH-1111 /PH-1111 ME-1111 Course Name Semester-1 Chemistry/Physics Basic Electrical Engineering Mathematics-I Engineering Graphics Communication Skills Chemistry/Physics Laboratory Workshop Physical Training-I NCC/NSO/NSS L 3 3 3 1 3 0 0 0 0 13 T 1 0 1 0 0 0 0 0 0 2 1 1 1 1 0 0 0 0 4 1 1 0 0 0 0 0 0 2 0 0 0 0 P 0 0 0 3 0 2 3 2 2 8 0 0 0 0 0 2 2 2 2 0 0 0 0 0 2 2 2 6 0 0 8 2 C 8 6 8 5 6 2 3 0 0 38 8 8 8 8 6 2 0 0 40 8 8 6 6 6 2 2 2 40 6 6 8 2 Course No EC-1101 CS-1101 MA-1102 ME-1101 PH-1101/ CH-1101 CS-1111 EE-1111 PH-1111/ CH-1111 Course Name Semester-2 Basic Electronics Introduction to Computing Mathematics-II Engineering Mechanics Physics/Chemistry Computing Laboratory Electrical Science Laboratory Physics/Chemistry Laboratory Physical Training –II NCC/NSO/NSS Semester-4 Structural Analysis-I Hydraulics Environmental Engg-I Structural Design-I Managerial Economics Engg. Geology Laboratory Hydraulics Laboratory Physical Training-IV NCC/NSO/NSS Semester-6 Structural Design-II Structural Analysis-III Foundation Engineering Transportation Engineering-II Hydrology &Flood...

Words: 126345 - Pages: 506

Free Essay

Computer

...Assembly Language Programming Lecture Notes Delivered by Belal Hashmi Compiled by Junaid Haroon Preface Assembly language programming develops a very basic and low level understanding of the computer. In higher level languages there is a distance between the computer and the programmer. This is because higher level languages are designed to be closer and friendlier to the programmer, thereby creating distance with the machine. This distance is covered by translators called compilers and interpreters. The aim of programming in assembly language is to bypass these intermediates and talk directly with the computer. There is a general impression that assembly language programming is a difficult chore and not everyone is capable enough to understand it. The reality is in contrast, as assembly language is a very simple subject. The wrong impression is created because it is very difficult to realize that the real computer can be so simple. Assembly language programming gives a freehand exposure to the computer and lets the programmer talk with it in its language. The only translator that remains between the programmer and the computer is there to symbolize the computer’s numeric world for the ease of remembering. To cover the practical aspects of assembly language programming, IBM PC based on Intel architecture will be used as an example. However this course will not be tied to a particular architecture as it is often done. In our view such an approach...

Words: 85913 - Pages: 344

Free Essay

Abcxyz

...program. Computer organization refers to the operational units and their interconnections that realize the architectural specifications. Examples of architectural attributes include the instruction set, the number of bits used to represent various data types (e.g., numbers, characters), I/O mechanisms, and techniques for addressing memory. Organizational attributes include those hardware details transparent to the programmer, such as control signals; interfaces between the computer and peripherals; and the memory technology used. 1.2 Computer structure refers to the way in which the components of a computer are interrelated. Computer function refers to the operation of each individual component as part of the structure. 1.3 Data processing; data storage; data movement; and control. 1.4 Central processing unit (CPU): Controls the operation of the computer and performs its data processing functions; often simply referred to as processor. Main memory: Stores data. I/O: Moves data between the computer and its external environment. System interconnection: Some mechanism that provides for communication among CPU, main memory, and I/O. A common example of system interconnection is by means of a system bus, consisting of a number of conducting wires to which all the other components attach. 1.5 Control unit: Controls the operation of the CPU and hence the computer Arithmetic and logic unit (ALU): Performs the computer’s data processing functions ...

Words: 12183 - Pages: 49

Premium Essay

Esrgt

.................................................. 27 Franchise Agreements .......................................................... 27 EVENING UNIVERSITY -GENERAL INFORMATION & REGULATIONS ................................................................................... 28 General Regulations for Bachelor of Science Degrees 28 General Regulations for Diploma Programmes ............ 36 General Regulations for Certificate Programmes ......... 37 STUDENT PRIZES .............................................................................. 38 CODE OF CONDUCT ........................................................................ 39 UNIVERSITY REGULATIONS ON PLAGIARISM .......................... 40 THE ACADEMIC SUPPORT/ DISABILITIES LIAISON UNIT (ASDLU) ............................................................................................... 42 POSTGRADUATE STUDIES IN THE FACULTY OF SOCIAL SCIENCES ............................................................................................ 43 Postgraduate Programmes 2014-2015 ............................ 44 FREQUENTLY ASKED QUESTIONS (FAQs) FOR FACULTY OF SOCIAL SCIENCES............................................................................. 46 General FAQS for All...

Words: 77086 - Pages: 309

Premium Essay

Project Report

...2014 Cost Reduction in Logistics Operations Vijay Ramamoorthy Roll No: 173 PGDM, Batch 19 A Project Report on “COST REDUCTION IN LOGISTICS OPERATIONS” A Project Report submitted in partial fulfilment of the requirement for the award of POST GRADUATE DIPLOMA IN MANAGEMENT (PGDM) Submitted by: Vijay Ramamoorthy PGDM, Roll No. 173, 19th Batch (2013-2015) Submitted on 01st July, 2014 Under the guidance of Mr. P. Meenakshi Sundaram Project guide (Deputy Manager, Logistics, CavinKare) XIME Xavier Institute of Management & Entrepreneurship Electronics City-Phase II, Bangalore-560100 Summer Internship Report 1|Page ACKNOWLEDGEMENT The 8 weeks of internship at CavinKare has been an enriching experience in terms of learning and application of theory into practice. The real time experience that I have received is something which cannot be emulated in a class room scenario and will be highly helpful for my professional growth. It has been a fruitful, exciting and value-adding exercise for me. It bears the imprint of many people, and I wish to express my sincere gratitude towards all those who made it possible. First, I would like to express my earnest appreciation and gratitude towards our President, Professor J. Philip, President, XIME for conceptualizing the summer training program. I would like to thank our Senior Dean, Mr. S.D.Tyagaraj for implementing the concept of summer training program. I am grateful to Mr. John Ben, my project guide, for guiding...

Words: 12790 - Pages: 52

Free Essay

Reverse Engineering

...About the Tutorial Assembly language is a low-level programming language for a computer or other programmable device specific to a particular computer architecture in contrast to most high-level programming languages, which are generally portable across multiple systems. Assembly language is converted into executable machine code by a utility program referred to as an assembler like NASM, MASM, etc. Audience This tutorial has been designed for those who want to learn the basics of assembly programming from scratch. This tutorial will give you enough understanding on assembly programming from where you can take yourself to higher levels of expertise. Prerequisites Before proceeding with this tutorial, you should have a basic understanding of Computer Programming terminologies. A basic understanding of any of the programming languages will help you in understanding the Assembly programming concepts and move fast on the learning track. Copyright & Disclaimer  Copyright 2014 by Tutorials Point (I) Pvt. Ltd. All the content and graphics published in this e-book are the property of Tutorials Point (I) Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or republish any contents or a part of contents of this e-book in any manner without written consent of the publisher. We strive to update the contents of our website and tutorials as timely and as precisely as possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt...

Words: 16458 - Pages: 66

Free Essay

Maori

...Estimation of optimal serum concentrations of 25-hydroxyvitamin D for multiple health outcomes1–3 Heike A Bischoff-Ferrari, Edward Giovannucci, Walter C Willett, Thomas Dietrich, and Bess Dawson-Hughes Downloaded from ajcn.nutrition.org at UNIVERSITY OF OTAGO SCIENCE LIBRARY on September 23, 2012 ABSTRACT Recent evidence suggests that vitamin D intakes above current recommendations may be associated with better health outcomes. However, optimal serum concentrations of 25-hydroxyvitamin D [25(OH)D] have not been defined. This review summarizes evidence from studies that evaluated thresholds for serum 25(OH)D concentrations in relation to bone mineral density (BMD), lowerextremity function, dental health, and risk of falls, fractures, and colorectal cancer. For all endpoints, the most advantageous serum concentrations of 25(OH)D begin at 75 nmol/L (30 ng/mL), and the best are between 90 and 100 nmol/L (36 – 40 ng/mL). In most persons, these concentrations could not be reached with the currently recommended intakes of 200 and 600 IU vitamin D/d for younger and older adults, respectively. A comparison of vitamin D intakes with achieved serum concentrations of 25(OH)D for the purpose of estimating optimal intakes led us to suggest that, for bone health in younger adults and all studied outcomes in older adults, an increase in the currently recommended intake of vitamin D is warranted. An intake for all adults of 1000 IU (40 g) vitamin D (cholecalciferol)/d is needed to bring vitamin...

Words: 12046 - Pages: 49

Premium Essay

Business

...Executive Summary This report aims at providing an overall analysis of the repayment behavior of the SME loan borrowers of Brac Bank Limited. Before going to the analysis, it is mandatory to know something about the organization, its core products that it offers to its customers; about the SME loan, its classifications and the whole of its process starting from loan sanction to recovery and closing of the loan. That’s why, first of all, I made an overview of the organization, BRAC bank Limited, where I had completed my internship program. Here I tried to focus the bank’s history of origination, its mission and vision, major departments and business units and major products and services. Then I said something about Asset Operations Department, the department where I was to perform my job responsibility. SME is the next section where I gave my concentration. Here I focused on the terms and conditions of giving SME loan, enterprise selection criteria and documentation. Then talked about the procedure of SME loan where I delineated the sanction, disbursement, repayment and closing of SME loan. After talking about the whole process of SME loan, I made an attempt to analyze the repayment behavior of SME loan borrowers. For this end in view, I have collected information about 20 SME borrowers. Then I have chosen eight major variables which have an impact on the recovery rate of SME loan. That is, these are the variables which may change the repayment behavior of SME borrowers...

Words: 16240 - Pages: 65

Free Essay

Business Organization

...Computer Organization and Design The Hardware/Software Interface F I F T H E D I T I O N David A. Patterson University of California, Berkeley John L. Hennessy Stanford University With contributions by Perry Alexander The University of Kansas Peter J. Ashenden Ashenden Designs Pty Ltd Jason D. Bakos University of South Carolina Javier Bruguera Universidade de Santiago de Compostela Jichuan Chang Hewlett-Packard Matthew Farrens University of California, Davis David Kaeli Northeastern University Nicole Kaiyan University of Adelaide David Kirk NVIDIA James R. Larus School of Computer and Communications Science at EPFL Jacob Leverich Hewlett-Packard Kevin Lim Hewlett-Packard John Nickolls NVIDIA John Oliver Cal Poly, San Luis Obispo Milos Prvulovic Georgia Tech Partha Ranganathan Hewlett-Packard Table of Contents Cover image Title page In Praise of Computer Organization and Design: The Hardware/Software Interface, Fifth Edition Front-matter Copyright Dedication Acknowledgments Preface About This Book About the Other Book Changes for the Fifth Edition Changes for the Fifth Edition Concluding Remarks Acknowledgments for the Fifth Edition 1. Computer Abstractions and Technology 1.1 Introduction 1.2 Eight Great Ideas in Computer Architecture 1.3 Below Your Program 1.4 Under the Covers 1.5 Technologies for Building Processors and Memory 1.6 Performance 1.7 The Power Wall 1.8 The Sea Change: The Switch from Uniprocessors to Multiprocessors 1.9 Real Stuff: Benchmarking...

Words: 79060 - Pages: 317

Premium Essay

Computer Organization and Architecture Designing for Performance 8th Edition

...COMPUTER ORGANIZATION AND ARCHITECTURE DESIGNING FOR PERFORMANCE EIGHTH EDITION William Stallings Prentice Hall Upper Saddle River, NJ 07458 Library of Congress Cataloging-in-Publication Data On File Vice President and Editorial Director: Marcia J. Horton Editor-in-Chief: Michael Hirsch Executive Editor: Tracy Dunkelberger Associate Editor: Melinda Haggerty Marketing Manager: Erin Davis Senior Managing Editor: Scott Disanno Production Editor: Rose Kernan Operations Specialist: Lisa McDowell Art Director: Kenny Beck Cover Design: Kristine Carney Director, Image Resource Center: Melinda Patelli Manager, Rights and Permissions: Zina Arabia Manager, Visual Research: Beth Brenzel Manager, Cover Visual Research & Permissions: Karen Sanatar Composition: Rakesh Poddar, Aptara®, Inc. Cover Image: Picturegarden /Image Bank /Getty Images, Inc. Copyright © 2010, 2006 by Pearson Education, Inc., Upper Saddle River, New Jersey, 07458. Pearson Prentice Hall. All rights reserved. Printed in the United States of America. This publication is protected by Copyright and permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to: Rights and Permissions Department. Pearson Prentice Hall™ is a trademark of Pearson Education, Inc. Pearson® is a registered trademark of...

Words: 239771 - Pages: 960

Premium Essay

Inventory Management

...302 INVENTORY MANAGEMENT A. COURSE OBJECTIVES At the end of this course you will be able to:- • Comprehend the importance of inventory management in an organisation and gain a broad understanding of how inventory management fits into the broader function of supply chain management. • Explain three broad areas of inventory management, namely; demand forecasting, inventory models and warehousing. • Apply inventory control models in day to day business management. B. COURSE CONTENTS LECTURE 1: INTRODUCTION TO INVENTORY MANAGEMENT 1. Introduction 2. Objectives 3. The Concepts of Inventory and Inventory Management 4. Need for Inventory 5. Importance of Inventory Management 6. Scope of Inventory Management 7. Inventory Costs 8. Summary 9. References LECTURE 2: INVENTORY CONTROL SYSTEMS 2.1 Introduction 2.2 objectives 2.3 Fixed Quantity System 2.31 Advantages 2.32 Disadvantages 2.4 Fixed Time System 2.41 Advantages 2.42 Disadvantages 2.5 Hybrid Systems 2.6 Summary LECTURE 3: DEMAND FORECASTING I 3.1 Introduction 3.2 objectives 3.3 meaning of demand forecasting 3.4 Qualitative Judgmental Techniques 3.31 Delphi Method 3.32 Market Survey 3.33 Historical Analogy 3.5 Quantitative methods 3.51 Causal Methods 3.5.1.1 High-Low Method Advantages Disadvantages 3.5.1.2 Visual Fit Method Advantages Disadvantages 3.5.1.3 Simple Regression Analysis Derivation of the Normal Equations Derivation of the Ordinary Least Squares...

Words: 31485 - Pages: 126

Premium Essay

Heuy2Kj4

...the essentials of Linda Null and Julia Lobur JONES AND BARTLETT COMPUTER SCIENCE the essentials of Linda Null Pennsylvania State University Julia Lobur Pennsylvania State University World Headquarters Jones and Bartlett Publishers 40 Tall Pine Drive Sudbury, MA 01776 978-443-5000 info@jbpub.com www.jbpub.com Jones and Bartlett Publishers Canada 2406 Nikanna Road Mississauga, ON L5C 2W6 CANADA Jones and Bartlett Publishers International Barb House, Barb Mews London W6 7PA UK Copyright © 2003 by Jones and Bartlett Publishers, Inc. Cover image © David Buffington / Getty Images Illustrations based upon and drawn from art provided by Julia Lobur Library of Congress Cataloging-in-Publication Data Null, Linda. The essentials of computer organization and architecture / Linda Null, Julia Lobur. p. cm. ISBN 0-7637-0444-X 1. Computer organization. 2. Computer architecture. I. Lobur, Julia. II. Title. QA76.9.C643 N85 2003 004.2’2—dc21 2002040576 All rights reserved. No part of the material protected by this copyright notice may be reproduced or utilized in any form, electronic or mechanical, including photocopying, recording, or any information storage or retrieval system, without written permission from the copyright owner. Chief Executive Officer: Clayton Jones Chief Operating Officer: Don W. Jones, Jr. Executive V.P. and Publisher: Robert W. Holland, Jr. V.P., Design and Production: Anne Spencer V.P., Manufacturing and...

Words: 118595 - Pages: 475

Premium Essay

Tata

...Doing Business in Vietnam: 2011 Country Commercial Guide for U.S. Companies INTERNATIONAL COPYRIGHT, U.S. & FOREIGN COMMERCIAL SERVICE AND U.S. DEPARTMENT OF STATE, 2011. ALL RIGHTS RESERVED OUTSIDE OF THE UNITED STATES. • • • • • • • • • • Chapter 1: Doing Business in Vietnam Chapter 2: Political and Economic Environment Chapter 3: Selling U.S. Products and Services Chapter 4: Leading Sectors for U.S. Export and Investment Chapter 5: Trade Regulations, Customs and Standards Chapter 6: Investment Climate Chapter 7: Trade and Project Financing Chapter 8: Business Travel Chapter 9: Contacts, Market Research and Trade Events Chapter 10: Guide to Our Services Return to table of contents Chapter 1: Doing Business in Vietnam • • • • Market Overview Market Challenges Market Opportunities Market Entry Strategy Return to top Market Overview • Vietnam is a true emerging market, offering ground floor and growing opportunities for U.S. exporters and investors. Vietnam’s economic growth rate has been among the highest in the world in recent years, expanding at an average about 7.2 percent per year during the period 2001-2010, while industrial production grew at an average of about 12 percent per year during the same period. Vietnam registered GDP growth rate of 6.7 percent in 2010 and was one of only a handful of countries around the world to experience such levels of economic growth. Moving forward, inflation remains a main risk to Vietnam’s economy, which the Government...

Words: 52699 - Pages: 211

Premium Essay

Computer Science Illuminated

...N E L L D A L E J O H N L E W I S illuminated computer science J O N E S A N D B A RT L E T T C O M P U T E R S C I E N C E computer science illuminated N E L L D A L E J O H N L E W I S computer science illuminated N E L L D A L E J O H N Villanova University L E W I S University of Texas, Austin Jones and Bartlett Publishers is pleased to provide Computer Science Illuminated’s book-specific website. This site offers a variety of resources designed to address multiple learning styles and enhance the learning experience. Goin’ Live This step-by-step HTML Tutorial will guide you from start to finish as you create your own website. With each lesson, you’ll gain experience and confidence working in the HTML language. Online Glossary We’ve made all the key terms used in the text easily accessible to you in this searchable online glossary. The Learning Store Jones and Bartlett Publishers has a wealth of material available to supplement the learning and teaching experience. Students and instructors will find additional resources here or at http://computerscience. jbpub.com The Language Library Here you will find two complete chapters that supplement the book’s language-neutral approach to programming concepts. A JAVA language chapter and C++ language chapter are included and follow the same pedagogical approach as the textbook. http://csilluminated.jbpub.com eLearning Our eLearning center provides chapter-specific...

Words: 67693 - Pages: 271

Free Essay

Weerttghh

...Chapter 2 An Overview of Formal Methods Tools and Techniques The goal of this chapter is to give an overview of the different approaches and tools pertaining to formal methods. We do not attempt to be exhaustive, but focus instead on the main approaches. After reading the chapter the reader will be familiar with the terminology of the area, as well as with the most important concepts and techniques. Moreover the chapter will allow the reader to contextualise and put into perspective the topics that are covered in detail in the book. Why do we need an overview of formal methods? Why not just study one rigorous method for software development? This is a very pertinent and legitimate question. The behavioural essence of software is not captured by a unique unified mathematical theory. Such a general foundation is unlikely to exist. Think for instance about the diversity of programming language paradigms and theories, and the resulting jungle of existing computer programming languages. Is there a definite paradigm (or, even, language) that makes obsolete all the other ones? Clearly not. Different languages will be chosen by different people to solve the same problem, and someone may well use different languages to solve different problems. Similarly, depending on the goals of the software designers and of the verification process, one may prefer a theory over another one, and even use more than one theory (and related formal methods techniques and tools), in the context of the development...

Words: 13418 - Pages: 54