Question

In: Computer Science

Write a program to store record of 15 Facebook users using Dictionary data type. Actual name...

  1. Write a program to store record of 15 Facebook users using Dictionary data type. Actual name record should hold username, number of friends, place, date of birth and the date their account was created.

https://realpython.com/python-lists-tuples/

https://realpython.com/python-dicts/

Solutions

Expert Solution

fb_dict = {'name':'Suhas', 'username': 'Suhasdouglas','friendslist':230,'place':'bangalore','DOB':22-10-1995,'Dateofcreation':18-8-2000}
print(fb_dict['name'])

print(fb_dict['username'])
print(fb_dict.get('friendlist'))
print(fb_dict['place'])

print(fb_dict.get('DOB'))

print(fb_dict.get('Dateofcreation'))

fb_dicti= {'name':'Vijay', 'username': 'vijaysethuphathi','friendslist':200,'place':'Chennai','DOB':29-12-1995,'Dateofcreation':14-9-2005}
print(fb_dicti['name'])

print(fb_dicti['username'])
print(fb_dicti.get('friendlist'))
print(fb_dicti['place'])

print(fb_dicti.get('DOB'))

print(fb_dicti.get('Dateofcreation'))

fb_dictio = {'name':'Kamal', 'username': 'kamalhasan','friendslist':500,'place':'Kerala','DOB':30-5-1992,'Dateofcreation':12-8-2000}
print(fb_dictio['name'])

print(fb_dictio['username'])
print(fb_dictio.get('friendlist'))
print(fb_dictio['place'])

print(fb_dictio.get('DOB'))

print(fb_dictio.get('Dateofcreation'))

fb_diction = {'name':'Manohar, 'username': 'manoharmanu','friendslist':230,'place':'Bangalore','DOB':25-10-1997,'Dateofcreation':12-5-2002}
print(fb_diction['name'])

print(fb_diction['username'])
print(fb_diction.get('friendlist'))
print(fb_diction['place'])

print(fb_diction.get('DOB'))

print(fb_diction.get('Dateofcreation'))

fb_dictiona = {'name':'Tarun', 'username': 'Tarunteja','friendslist':230,'place':'bangalore','DOB':22-10-1994,'Dateofcreation':18-8-2000}
print(fb_dictiona['name'])

print(fb_dictiona['username'])
print(fb_dictiona.get('friendlist'))
print(fb_dictiona['place'])

print(fb_dictiona.get('DOB'))

print(fb_dictiona.get('Dateofcreation'))

fb_di= {'name':'Akhil', 'username': 'Akhilakki','friendslist':230,'place':'bangalore','DOB':22-1-1990,'Dateofcreation':12-1_2000}
print(fb_di['name'])

print(fb_di['username'])
print(fb_di.get('friendlist'))
print(fb_di['place'])

print(fb_di.get('DOB'))

print(fb_di.get('Dateofcreation'))

fb_d = {'name':'Gopi', 'username': 'Gopichand','friendslist':600,'place':'Bangalore','DOB':22-3-1991,'Dateofcreation':18-8-2005}
print(fb_d['name'])

print(fb_d['username'])
print(fb_d.get('friendlist'))
print(fb_d['place'])

print(fb_d.get('DOB'))

print(fb_d.get('Dateofcreation'))

fb_id = {'name':'Rajesh', 'username': 'Rajeshhero','friendslist':2000,'place':'bangalore','DOB':19_10-1995,'Dateofcreation':18-8-2010}
print(fb_id['name'])

print(fb_id['username'])
print(fb_id.get('friendlist'))
print(fb_id['place'])

print(fb_id.get('DOB'))

print(fb_id.get('Dateofcreation'))

fb_idr = {'name':'Prasad', 'username': 'prasadachanta','friendslist':700,'place':'Delhi,'DOB':22-10-199,'Dateofcreation':11-8-2006}
print(fb_idr['name'])

print(fb_idr['username'])
print(fb_idr.get('friendlist'))
print(fb_idr['place'])

print(fb_idr.get('DOB'))

print(fb_idrt.get('Dateofcreation'))

fb_dicter= {'name':'Azeem, 'username': 'Azeemabdul','friendslist':500,'place':'Vijaywada','DOB':30-1-1991,'Dateofcreation':18-2_2000}
print(fb_dicter['name'])

print(fb_dicter['username'])
print(fb_dicter.get('friendlist'))
print(fb_dicter['place'])

print(fb_dicter.get('DOB'))

print(fb_dicter.get('Dateofcreation'))

fb_st = {'name':'Nagesh', 'username': 'Nageshhh','friendslist':3000,'place':'Bangalore','DOB':22-10-1995,'Dateofcreation':18-8-2000}
print(fb_stt['name'])

print(fb_st['username'])
print(fb_st.get('friendlist'))
print(fb_st['place'])

print(fb_st.get('DOB'))

print(fb_st.get('Dateofcreation'))

fb_r = {'name':'Sampoornesh, 'username': 'Sampu','friendslist':350,'place':'Hyderabad','DOB':22-10-1995,'Dateofcreation':18-8-2000}
print(fb_r['name'])

print(fb_r['username'])
print(fb_r.get('friendlist'))
print(fb_r['place'])

print(fb_r.get('DOB'))

print(fb_r.get('Dateofcreation'))

fb_i = {'name':'Srinivas', 'username': 'srinu','friendslist':230,'place':'Mayapur','DOB':28-10-1995,'Dateofcreation':18-8-2010}
print(fb_i['name'])

print(fb_i['username'])
print(fb_i.get('friendlist'))
print(fb_i['place'])

print(fb_i.get('DOB'))

print(fb_i.get('Dateofcreation'))

fb_e= {'name':'Prabhas', 'username': 'Prabhassahu','friendslist':210,'place':'Hyderabad','DOB':22-08-1975,'Dateofcreation':18-8-2000}
print(fb_e['name'])

print(fb_e['username'])
print(fb_e.get('friendlist'))
print(fb_e['place'])

print(fb_e.get('DOB'))

print(fb_e.get('Dateofcreation'))

fb_f = {'name':'Surya', 'username': 'Suryasingham','friendslist':129,'place':'chennai','DOB':14-6-1982,'Dateofcreation':13-12-2012}
print(fb_f['name'])

print(fb_f['username'])
print(fb_f.get('friendlist'))
print(fb_f['place'])

print(fb_f.get('DOB'))

print(fb_f.get('Dateofcreation'))


Related Solutions

Facebook penetration values (the percentage of a country’s population that are Facebook users) for 15 randomly...
Facebook penetration values (the percentage of a country’s population that are Facebook users) for 15 randomly selected countries are: 52.56, 33.09, 5.37, 19.41, 32.52, 41.69, 51.61, 30.12, 39.07, 30.62, 38.16, 49.35, 27.13, 53.45, 40.01. Give point estimates for the population mean Facebook penetration (µ), and the population standard deviation of Facebook penetration (σ). Construct a 95% confidence interval estimation for µ. Interpret. Construct a 95% confidence interval estimation for σ. Interpret. What assumptions do you need to make about the...
Write a program that defines an animal data type, with an animal name, age, and category...
Write a program that defines an animal data type, with an animal name, age, and category (cat, dog, etc.), as well as an animal array type that stores an array of animal pointers. (ex. structType *arr[size];) Your program will prompt the user to enter the data for as many animals as they wish. It will initialize a dynamically allocated animal structure for each animal, and it will store each animal in an instance of the animal array structure. Your program...
Write a program that defines an animal data type, with an animal name, age, and category...
Write a program that defines an animal data type, with an animal name, age, and category (cat, dog, etc.), as well as an animal array type that stores an array of animal pointers. Your program will prompt the user to enter the data for as many animals as they wish. It will initialize a dynamically allocated animal structure for each animal, and it will store each animal in an instance of the animal array structure. Your program will then print...
write a java program that implements the splay tree data structure for the dictionary abstract data...
write a java program that implements the splay tree data structure for the dictionary abstract data type. Initially the program reads data from "in.dat", and establishes an ordinary binary search tree by inserting the data into the tree. The data file contains integers, one per line. in.dat file contents: 3456 5678 1234 2369 7721 3354 1321 4946 3210 8765 Then the program starts an interactive mode. The commands are as follows. S 1000 - splay the tree at 1000 F...
3. Write a C++ program that takes in the name of a store, and the following...
3. Write a C++ program that takes in the name of a store, and the following details for 4 employees working at the store; their first name, last name, number of hours they worked that week and how much they are paid per hour. Your program should output the name of the store, along with each employee's full name and how much they earned that week in the manner below. Monetary values should be format to 2 decimal places. Also...
Write a program in c# that declare a variable and store user name jjohn in. Then,...
Write a program in c# that declare a variable and store user name jjohn in. Then, write a statement that will make your program display at the screen the content of that variable, followed by " I would like to know your height in centimeter. Please enter it:". Then, write a statement that will store the value entered by the user, allowing decimal numbers ie some precision, a fraction part. Finally, write statements (more than one can be needed) so...
Write a program named filemaker.py in python that will be used to store the first name...
Write a program named filemaker.py in python that will be used to store the first name and age of some friends in a text file named friends.txt. The program must use a while loop that prompts the user to enter the first name and age of each friend. Each of these entries should be written to its own line in the text file (2 lines of data per friend). The while loop should repeat until the user presses Enter (Return...
Using Ruby. Create a program that prompt the users for his full name For example: Brian...
Using Ruby. Create a program that prompt the users for his full name For example: Brian Smith You code should swap the first name to last and last name to first and display the result. Smith Brian Your code should run for any combination of first name and last name. Hint: Research around String class methods in Ruby. The separator is the space in between first and last name. Please submit your code, as well as screenshot of how your...
Write a program using multiple functions. Make use of an array to store data Make use...
Write a program using multiple functions. Make use of an array to store data Make use of searching techniques Read data from a file Write data to a file Instructions: In this lab, you will be examining a set of stock collected over a twenty four day period. Be sure to make use of an array to store these stocks. You will be required to read in the data points from a file. Write a function to read in the...
Write a C program that allows users to enter three runners name (up to 20 characters)...
Write a C program that allows users to enter three runners name (up to 20 characters) and their runtime (2 decimals) (1) First and Last name (2) Running time for 100 m ex. 9.96 seconds your program should rank them in ascending order of their runtime. example: usian Bolt - 9.96 sec - First Place John doe - 9.99 sec - second Place Pete Urel -10.11 sec - third place BUT they fan tie for first place and no second...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT