UrbanPro
true

Learn Python Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Facebook Analytics

Logeswaran
03/09/2019 0 0

Assume how the Facebook application will store the millions of customer's record in real-time:

facebook = {
'jose': {
'name': 'jose', 'age': 33,
'hobby': ['cricket', 'python'], # cricket,football
'mobile': 1111111111, 'email': 'joset@gmail.com',
'contacts':[6666666666,3333333333,4444444444],
'pages': {
'python': {'sudha', 'priyanka'},
'BusinessMantra': {'sudha', 'oviya'}
}
},
'sudha': {
'name': 'sudha', 'age': 32, 'hobby': ['Khabadi', 'Movies', chess'],
'mobile': 2222222222, 'email': 'sudha.ram@gmail.com',
'contacts':[5555555555],
'pages':{
'python':{'sudha', 'lok'},
'furnitures': {'chris', 'priyanka'}
}
},
'lok': {
'name': 'lok', 'age': 26, 'hobby': ['python','football'],
'mobile': 3333333333, 'email': 'lok123@gmail.com',
'contacts':[3333333333,7777777777],
'pages':{
'python':{'chris', 'priyanka', 'jose'}
}
},
'priyanka': {
'name': 'priyanka', 'age': 26, 'hobby': 'football',
'mobile': 4444444444, 'email': 'pravi@gmail.com',
'contacts':[5555555555,3333333333,4444444444],
'pages':{'python':{'chris', 'jose'}}
},
'chris': {
'name': 'chris', 'age': 35, 'hobby': 'football',
'mobile': 5555555555, 'email': 'christopher.e@gmail.com',
'contacts':[6666666666,3333333333,4444444444]}
}

 

If you look closely, the above stores 5 persons information in a structured form. Moreover, we can have any value as any type as to learn as much as of python-datatypes, in other terms, the main motive of storing in this structure is to learn all the data-types of python.

Assignment I(Store data):

  1. You have to allow fb-customer to enter multiple hobbies with comma separator(,) and you have to store them as a list in db.
    Ex: 'jose': {'name': 'jose', 'age': '33', 'hobby': ['cricket', 'python']
  2. Sync Contacts: Basically facebook(Messenger) will sync all your contacts to it's database. Here, the user will enter all his contacts(mobile numbers) with comma separator, that you have to store as a list like below,
    input: '6666666666,3333333333,4444444444' and store it in db like the below,
    'contacts':[6666666666,3333333333,4444444444]
  3. Validate the input of mobile number as 10-digit(Ex:9876543210), ask repeatedly if they enter invalid input.
    Ex: Enter you mobile number:88 (if the user entered non 10-digit number, ask them correct mobile number until the valid input)
    Enter valid mobile number: 9876543210
  4. Validate the Email-id with the format of Gmail account
  5. Get the Age and Mobile number as integer input
  6. A customer can run any number of pages, add an item as the above sample into their database with the pages and it's followers(set datatype)

Assignment II(Read operation):

  1. Find the person who has the hobby same as I am looking: List all the customer who has cricket as hobby
  2. Find the Target group for digital advt: A customer approaching FB to promote his page. How will they find the intended audience for the page-suggestion?
    Ex: I wants to promote my 'Python Development&Automation' page, then how will you pick the right person for my page among the millions of user-profile exist in the fb db.
  3. Suggest Friend: We usually get friend suggestion from facebook analytics. Have you ever wonder how does it work..? Let's simulate this.
    As you know the pattern of stored data(facebook), you can classify the category like(same School/Company/Community/Birthplace/CurrentLocation/Contacts)
  4. When the customer posting a status on their page, we have to let this know to all the followers
    Ex: sudha wants to post the status in his ‘furnitures’ page, notify this to all it's followers

 

0 Dislike
Follow 2

Please Enter a comment

Submit

Other Lessons for You

Back Reference In Python Regex
What if your interviewer asks about this? We know Regex have some useful functions like: match ( Ex: re.match(pattern,dataSource) ) search ( Ex: re.search(pattern,dataSource) ) sub ...

Python SubProcess
Question: As a Network Administrator, one of my trainee wants to know the below: He has certain number of Machines(IP’s). On daily basic he wants to know how many IP’s are reachable and...

Black in Python
When you are upturn in your career from beginner to experienced in programming world, your team will start looking at ‘how you are writing?’ Here the responsibility piling up. Okay,...

Python Concurrent v/s Parallel Programming
Concurrent means, more than one task happening at a time in interleaved fashion, (ie.,)Task 'A' starts, and Task 'B' starts before task 'A' finish, after processing its(A and B) own purpose both the task...

Decorator in Python - Simplified
By definition, a decorator is a function that takes another function andextends(/decorates) the behaviour of the latter function without explicitly modifying it.Let see how we can apply decorators for...
X

Looking for Python Training Classes?

The best tutors for Python Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Python Training with the Best Tutors

The best Tutors for Python Training Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more