Python- Creating Dictionary,
Accessing and Modifying key: value Pairs in Dictionaries
Built-In Functions used on Dictionaries,
Dictionary Methods
Removing items from dictionary
Learn how to use lists in Java, how to use List<T> and ArrayList<T>, how to process lists of elements.
Watch the video lesson and access the hands-on exercises here: https://softuni.org/code-lessons/java-foundations-certification-lists
Learn how to use lists in Java, how to use List<T> and ArrayList<T>, how to process lists of elements.
Watch the video lesson and access the hands-on exercises here: https://softuni.org/code-lessons/java-foundations-certification-lists
Java Foundations: Maps, Lambda and Stream APISvetlin Nakov
Learn how to work with maps in Java, how to use the Map<K, V> interface and the API classes HashMap<K,V> and TreeMap<K, V>. Learn how to work with lambda expressions and how to use the Java stream API to process sequences of elements, how to filter, transform and order sequences.
Watch the video lesson and access the hands-on exercises here: https://softuni.org/code-lessons/java-foundations-certification-maps-lambda-and-stream-api/
A function is a set of statements that take inputs, do some specific computation and produces output. The idea is to put some commonly or repeatedly done task together and make a function, so that instead of writing the same code again and again for different inputs, we can call the function.
Python provides built-in functions like print(), etc. but we can also create your own functions. These functions are called user-defined functions.
Learn how to use arrays in Java, how to enter array, how to traverse an array, how to print array and more array operations.
Watch the video lesson and access the hands-on exercises here: https://softuni.org/code-lessons/java-foundations-certification-arrays
learn how to program with python
from scratch to be an expert
use the link in the first slide to get the full course
here is the link if you want : https://oke.io/JdxdUl
the link of the documentation : https://oke.io/J6DeY3
link to download python : https://oke.io/BENgRLR2
In this chapter we will review how to work with text files in C#. We will explain what a stream is, what its purpose is, and how to use it. We will explain what a text file is and how can you read and write data to a text file and how to deal with different character encodings. We will demonstrate and explain the good practices for exception handling when working with files. All of this will be demonstrated with many examples in this chapter
Chapter 22. Lambda Expressions and LINQIntro C# Book
In this chapter we will become acquainted with some of the advanced capabilities of the C# language. To be more specific, we will pay attention on how to make queries to collections, using lambda expressions and LINQ, and how to add functionality to already created classes, using extension methods. We will get to know the anonymous types, describe their usage briefly and discuss lambda expressions and show in practice how most of the built-in lambda functions work. Afterwards, we will pay more attention to the LINQ syntax – we will learn what it is, how it works and what queries we can build with it. In the end, we will get to know the meaning of the keywords in LINQ, and demonstrate their capabilities with lots of examples.
Numerical tour in the Python eco-system: Python, NumPy, scikit-learnArnaud Joly
We first present the Python programming language and the NumPy package for scientific computing. Then, we devise a digit recognition system highlighting the scikit-learn package.
Java Foundations: Maps, Lambda and Stream APISvetlin Nakov
Learn how to work with maps in Java, how to use the Map<K, V> interface and the API classes HashMap<K,V> and TreeMap<K, V>. Learn how to work with lambda expressions and how to use the Java stream API to process sequences of elements, how to filter, transform and order sequences.
Watch the video lesson and access the hands-on exercises here: https://softuni.org/code-lessons/java-foundations-certification-maps-lambda-and-stream-api/
A function is a set of statements that take inputs, do some specific computation and produces output. The idea is to put some commonly or repeatedly done task together and make a function, so that instead of writing the same code again and again for different inputs, we can call the function.
Python provides built-in functions like print(), etc. but we can also create your own functions. These functions are called user-defined functions.
Learn how to use arrays in Java, how to enter array, how to traverse an array, how to print array and more array operations.
Watch the video lesson and access the hands-on exercises here: https://softuni.org/code-lessons/java-foundations-certification-arrays
learn how to program with python
from scratch to be an expert
use the link in the first slide to get the full course
here is the link if you want : https://oke.io/JdxdUl
the link of the documentation : https://oke.io/J6DeY3
link to download python : https://oke.io/BENgRLR2
In this chapter we will review how to work with text files in C#. We will explain what a stream is, what its purpose is, and how to use it. We will explain what a text file is and how can you read and write data to a text file and how to deal with different character encodings. We will demonstrate and explain the good practices for exception handling when working with files. All of this will be demonstrated with many examples in this chapter
Chapter 22. Lambda Expressions and LINQIntro C# Book
In this chapter we will become acquainted with some of the advanced capabilities of the C# language. To be more specific, we will pay attention on how to make queries to collections, using lambda expressions and LINQ, and how to add functionality to already created classes, using extension methods. We will get to know the anonymous types, describe their usage briefly and discuss lambda expressions and show in practice how most of the built-in lambda functions work. Afterwards, we will pay more attention to the LINQ syntax – we will learn what it is, how it works and what queries we can build with it. In the end, we will get to know the meaning of the keywords in LINQ, and demonstrate their capabilities with lots of examples.
Numerical tour in the Python eco-system: Python, NumPy, scikit-learnArnaud Joly
We first present the Python programming language and the NumPy package for scientific computing. Then, we devise a digit recognition system highlighting the scikit-learn package.
These are the slides of the second part of this multi-part series, from Learn Python Den Haag meetup group. It covers List comprehensions, Dictionary comprehensions and functions.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
Acetabularia Information For Class 9 .docxvaibhavrinwa19
Acetabularia acetabulum is a single-celled green alga that in its vegetative state is morphologically differentiated into a basal rhizoid and an axially elongated stalk, which bears whorls of branching hairs. The single diploid nucleus resides in the rhizoid.
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
Thesis Statement for students diagnonsed withADHD.ppt
Python programming –part 7
1. Python Programming –Part 7
Megha V
Research Scholar
Dept.of IT
Kannur University
16-11-2021 meghav@kannuruniv.ac.in 1
2. Dictionary
• Creating Dictionary,
• Accessing and Modifying key : value Pairs in Dictionaries
• Built-In Functions used on Dictionaries,
• Dictionary Methods
• Removing items from dictonary
16-11-2021 meghav@kannuruniv.ac.in 2
3. Dictionary
• Unordered collection of key-value pairs
• Defined within braces {}
• Values can be accessed and assigned using square braces []
• Keys are usually numbers or strings
• Values can be any arbitrary Python object
16-11-2021 meghav@kannuruniv.ac.in 3
4. Dictionary
Creating a dictionary and accessing element from dictionary
Example:
dict={}
dict[‘one’]=“This is one”
dict[2]=“This is two”
tinydict={‘name’:’jogn’,’code’:6734,’dept’:’sales’}
studentdict={‘name’:’john’,’marks’:[35,80,90]}
print(dict[‘one’]) #This is one
print(dict[2]) #This is two
print(tinydict) #{name’:’john’,’code’:6734,’dept’:’sales’}
print(tinydict.keys())#dict_keys([’name’,’code’,’dept’])
print(tinydict.value())#dict_values([’john’,6734,’sales’])
print(studentdict) #{name’:’john’,’marks’:[35,80,90])
16-11-2021 meghav@kannuruniv.ac.in 4
5. Dictionary
• We can update a dictionary by adding a new key-value pair or modifying an existing entry
Example:
dict1={‘Name’:’Tom’,’Age’:20,’Height’:160}
print(dict1)
dictl[‘Age’]=25 #updating existing value in Key-Value pair
print ("Dictionary after update:",dictl)
dictl['Weight’]=60 #Adding new Key-value pair
print (" Dictionary after adding new Key-value pair:",dictl)
Output
{'Age':20,'Name':'Tom','Height':160}
Dictionary after update: {'Age’:25,'Name':'Tom','Height': 160)
Dictionary after adding new Key-value pair:
{'Age’:25,'Name':'Tom',' Weight':60,'Height':160}
16-11-2021 meghav@kannuruniv.ac.in 5
6. Dictionary
• We can delete the entire dictionary elements or individual elements in a dictionary.
• We can use del statement to delete the dictionary completely.
• To remove entire elements of a dictionary, we can use the clear() method
Example Program
dictl={'Name':'Tom','Age':20,'Height':160}
print(dictl)
del dictl['Age’] #deleting Key-value pair'Age':20
print ("Dictionary after deletion:",dictl)
dictl.clear() #Clearing entire dictionary
print(dictl)
Output
{'Age': 20, 'Name':'Tom','Height': 160}
Dictionary after deletion: {‘Nme ':' Tom','Height': 160}
{}
16-11-2021 meghav@kannuruniv.ac.in 6
7. Properties of Dictionary Keys
• More than one entry per key is not allowed.
• No duplicate key is allowed.
• When duplicate keys are encountered during assignment, the
last assignment is taken.
• Keys are immutable- keys can be numbers, strings or
tuple.
• It does not permit mutable objects like lists.
16-11-2021 meghav@kannuruniv.ac.in 7
8. Built-In Dictionary Functions
1.len(dict) - Gives the length of the dictionary.
Example Program
dict1= {'Name':'Tom','Age':20,'Height':160}
print(dict1)
print("Length of Dictionary=",len(dict1))
Output
{'Age': 20, 'Name': 'Tom', 'Height': 160}
Length of Dictionary= 3
16-11-2021 meghav@kannuruniv.ac.in 8
9. Built-In Dictionary Functions
2.str(dict) - Produces a printable string representation of the dictionary.
Example Program
dict1= {'Name':'Tom','Age':20,'Height' :160}
print(dict1)
print("Representation of Dictionary=",str(dict1))
Output
{'Age': 20, 'Name': 'Tom', 'Height': 160}
Representation of Dictionary= {'Age': 20, 'Name': 'Tom', 'Height': 160}
16-11-2021 meghav@kannuruniv.ac.in 9
10. Built-In Dictionary Functions
3.type(variable)
• The method type() returns the type of the passed variable.
• If passed variable is dictionary then it would return a dictionary type.
• This function can be applied to any variable type like number, string,
list, tuple etc.
16-11-2021 meghav@kannuruniv.ac.in 10
12. Built-in Dictionary Methods
1.dict.clear() - Removes all elements of dictionary dict.
Example Program
dict1={'Name':'Tom','Age':20,'Height':160}
print(dict1)
dict1.clear()
print(dict1)
Output
{'Age': 20, 'Name':' Tom’ ,'Height': 160}
{}
16-11-2021 meghav@kannuruniv.ac.in 12
13. 2.dict.copy() - Returns a copy of the dictionary dict().
3.dict.keys() - Returns a list of keys in dictionary dict
- The values of the keys will be displayed in a random order.
- In order to retrieve keys in sorted order, we can use the sorted() function.
- But for using the sorted() function, all the key should of the same type.
4. dict.values() -This method returns list of all values available in a dictionary
-The values will be displayed in a random order.
- In order to retrieve the values in sorted order, we can use the sorted()
function.
- But for using the sorted() function, all the values should of the same type
16-11-2021 meghav@kannuruniv.ac.in 13
Built-in Dictionary Methods
14. Built-in Dictionary Methods
5. dict.items() - Returns a list of dictionary dict's(key,value) tuple pairs.
dict1={'Name':'Tom','Age':20,'Height’:160}
print(dict1)
print("Items in Dictionary:",dict1.items())
Output
{'Age': 20, 'Name': 'Tom', 'Height': 160}
tems in Dictionary:[('Age', 20),( ' Name ' ,'Tom’), ('Height', 160)]
16-11-2021 meghav@kannuruniv.ac.in 14
16. Built-in Dictionary Methods
7. dict.has_key(key) – Returns true if the key is present in the dictionary, else False
is returned
8. dict.get(key,default=None) – Returns the value corresponding to the key
specified and if the key is not present, it returns the default value
9. dict.setdefault(key,default=None) – Similar to dict.get() byt it will set the key
with the value passed and if the key is not present it will set with default value
10. dict.fromkeys(seq,[val]) – Creates a new dictionary from sequence ‘seq’ and
values from ‘val’
16-11-2021 meghav@kannuruniv.ac.in 16
17. Removing Items from a Dictionary
• The pop() method removes the item with the specified key name.
thisdict={"brand":"Ford","model":"Mustang","year":1964}
thisdict.pop("model")
print(thisdict)
• The popitem() method removes the last inserted item (in versions before 3.7, a random item
is removed instead):
thisdict = {"brand":"Ford","model":"Mustang","year":1964}
thisdict.popitem()
print(thisdict)
16-11-2021 meghav@kannuruniv.ac.in 17
18. Removing Items from a Dictionary
• The del keyword removes the item with the specified key name:
thisdict={"brand":"Ford","model":"Mustang","year":1964}
del thisdict["model"]
print(thisdict)
• The del keyword can also delete the dictionary completely:
thisdict={"brand":"Ford","model":"Mustang","year":1964}
del thisdict
print(thisdict) #this will cause an error because "thisdict“ no
#longer exists.
• The clear() keyword empties the dictionary
thisdict.clear()
16-11-2021 meghav@kannuruniv.ac.in 18
19. LAB ASSIGNMENT
• Write a Python program to sort(ascending and descending) a dictionary by
value
• Write python script to add key-value pair to dictionary
• Write a Python script to merge two dictionaries
16-11-2021 meghav@kannuruniv.ac.in 19