Why is it useful to store information with different data types? When do you choose to use a list over a dictionary? Provide a code example that supports your comments:I need help explaining this question although this has been answered it is a little confusing for someone new to code,thanks in advance.
Data types specify the type of data or the category of data which use.For example some datatypes are:-
There are a more data types. But using different data types helps user to use different types of data
List :- is a data structure which can store items.these items can be of different. an example to use this is when you need to make a list of friends.
Dictionary: is a data structure which store two values one of which is key and other is value. so if you want to store something like a means/ equals to b then you can use a dictionary.
Python code
# Making 2 dictionaries
#means dictionar key:word value is meaning
# numFactors dictionary key:number value:number of factors
mean={"accidial":"Dialing someone's Number
accidentally","awesome":"extremely good"}
numFactors={1:1,2:2,3:2,4:3,5:2}
#using dictionary
print('accidial means',mean['accidial'])
print('number of factors of 5 is',numFactors[5])
#using lists
list=['ankit','john','Tarun']
print(list)
#accessing a element in a list can be done by index .i.e position
of the item
#the numbering of the position starts from 0..
print(list[0])


Why is it useful to store information with different data types? When do you choose to...
Discuss the importance of written contracts in certain situations - why do courts require these contracts be in writing? Choose one of the types of written contracts and discuss whether you think it's valid. Provide your own thoughts, as well as supporting sources from the internet. Provide a real-world or made up example to support your point.
I need help answering the following: Why does the following code not compile? List<Integer> intList = new ArrayList<>(); List<Number> numList = intList; a). The types list and ArrayList are different b). Integer is not a subclass of Number. c). List<Integer> is not a subclass of List<Number> d). There is a syntax error. Which of the following statements about Java I/O streams is true? a). I/O streams are only useful for reading to / writing from files on disk b). Character...
In this assignment you will provide a Python script which will calculate the Biorhythms for an individual and present the data graphically using libraries and a common algorithm. Assessment Details: Biorhythms were developed by Wilhelm Fließ, a colleague of Sigmund Freud, in the 19th century and were very popular in the 1970s (Troutman, 1978); despite criticisms they are still used today in fields such as work safety to sports performance (Arab, Omidvari, & Nasiripour, 2014; Zareian, Rabbani, & Saeedi, 2014)....
Create a program (Lab9_Act1_Write.py) that will read in data from the keyboard and store it in a file. Your program should prompt the user for the name of the file to use and then request values be entered until the user is done. This data should be written to two files: a text file, user_file_name.txt and a comma separated value file, user_file_name.csv. To help you with decision making, we suggest that you ask the user to input data representing students’...
IN C# Objectives: Create an application that uses a dictionary collection to store information about an object. Understanding of abstract classes and how to use them Utilize override with an abstract class Understanding of Interfaces and how to use them Implement an Interface to create a “contract” between classes. Compare and contrast inheritance and interfaces. Instructions: Interface: Create an interface called ITrainable which contains the following: Dictionary<string, string> Behaviors{ get; set; } string Perform(String signal); string Train(String signal, string behavior);...
Could anyone help add to my python code? I now need to calculate the mean and median. In this programming assignment you are to extend the program you wrote for Number Stats to determine the median and mode of the numbers read from the file. You are to create a program called numstat2.py that reads a series of integer numbers from a file and determines and displays the following: The name of the file. The sum of the numbers. The...
This is a C++ question we do not use namespace std at the beginning of the program 9. Arrays: Functions and Reading From File Although this code is a little long, the strategy is straightforward and it will really help you practice functions. I have provided a large amount of detail to help you out. In a nutshell, you're going to read some numbers from a file (into an array) and then ask the user for a number that will...
Do WITHOUT #include<sstream> C++ You are to write a program that will read in upto 15 names, rearrange each person's name. The list has been collected from different places and the names are not in some standard format. A person's last name may appear last or it may appeaer first. A label has been associated with each name to identify where the last name appears. Either "surname" or "lastname" appears just before a person's last name. The other will be...
i need this in C# please can any one help me out and write the full code start from using system till end i am confused and C# is getting me hard.I saw codes from old posts in Chegg but i need the ful complete code please thanks. Module 4 Programming Assignment – OO Design and implementation (50 points) Our Battleship game needs to store a set of ships. Create a new class called Ships. Ships should have the following...
%%%%Python Question%%% Work from the template acrostic.py, which you can find on the ELMS page for this assignment. • In the Generator class, write an __init__() method with two parameters: self and the path to a text file containing one word per line. This method should read the words from the file, strip off leading and trailing whitespace, and store them in a dictionary where each key is a lower-case letter and each corresponding value is a list of words...