Python Answers

Questions answered by Experts: 5 288

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

Lucky Pairs

Two numbers are said to be lucky pairs . if first number is divided by second number and second number is divided by first number. given an integer N . find all possible combinations of lucky pairs.



input:

2


output:

2


Explanation:

input is 2

possible combinations are [1,2],[2,1].here in [1,2]1 is divisible by 2, and in [2,1] 2 is divisible by 1 .so the number of lucky pairs are 2.



Project 5: Social Media account

Implement a program that manages the data of the social media account. The user can access only his/her own account. The account is characterized by username, password, name, sumame, birth date and list of friends (characterised by the account username). The data are stored into a json file. The application should manage the following characteristics:

Sign up: register to the system

Sign in: by providing usename and password and showing all the user data

Search for a user (using name and surname)

Add a used to the friend list

Changes need to be stored back in the file. The above functionalities are implemented through methods of a class named SocialMedia. The application interacts with the user through a menu where the user is asked for the next action to undertake (e.g., 1-Sign Up, 2

Sign In, etc.) Put comments in your code.


Project 4: Music Store

Implement a program that manages the data of a music store. The store manages the list of CDs that can be bought. For each CD, the store has the following data: album title, singer/band name, recording house, published year, music genre, and a list of song titles.

The data are stored into a json file. The application should manage the following characteristics:

Add a new CD

Remove existing CD

Show all CDs of a given singer/band .    Show all CDs containing a specific song (identified by song title)

Changes need to be stored back in the file. The above functionalities are implemented through methods of a class named TravelAgency. The application interacts with the user through a menu where the user is asked for the next action to undertake (e.g., 1-Add new CD, 2-Remove existing CD, etc.) Put comments in your code.


Project 2: Travel Agency

Implement a program that manages the data of a travel agency. The agency manages the list of hotels that accommodate tourists. For each hotel the agency has the following data: name, address, city, country, number of starts, price per night and a list of facilities. The data are stored into a json file. The application should manage the following characteristics: add a new hotel , remove existing hotel (identified by name) , show hotels of a specific city or country, show hotels that provide a specific facility (e.g., free wifi)

Changes need to be stored back in the file. The above functionalities are implemented through methods of a class named TravelAgency. The application interacts with the user through a menu where the user is asked for the next action to undertake (e.g., 1 -Add new hotel, 2- Remove existing hotel, etc.) Put comments on your code.


Project 1: Phonebook

Implement a program that manages a smartphone phonebook. Each contact might have the following data: name, surname, birthday and a set of Phone Numbers (to the same contact we may assign several phone numbers). The data are stored into a json file. The application should manage the following characteristics: create and add new contact the book ,remove existing contact (contacts are identified by name) , show all the contact , show the list of persons among your contact the has the birthdate

Changes need to be stored back in the file. The above functionalities are implemented through methods of a class named PhoneBook. The application interacts with the user through a menu where the user is asked for the next action to undertake (e.g., 1-Add new contact, 2- Remove Existing contact, etc.) Put comments in your code


How do I implement minimum heap on date and time, e.g. 23/7/2021 23:45, 24/5/2021 22:10, 20/5/2021 20:00. To implement minimum heap on the example.


We run the "Word mix" code , The output will be like this


The nth word in the output should contain nth letter of each word in the given sentence. The letters of the output word should be in same order as the words in the given sentence. If a word in the given sentence doesn't have n-letters, you can skip it while considering the letters of the n-th word.


Ex: Input :: Welcome to your first problem


Output :: Wtyfp eooir luro crsb otl me em


But,run the above code displayed only "Wtyfp" .


Given a string, write a program to print a secret message that replaces characters with numbers 'a' with 1, 'b' with 2, ..., 'z' with 26 where characters are separated by '-'.


Note: You need to replace both uppercase and lowercase characters. You can ignore replacing all characters that are not letters.


abcdefghij12345678910

klmnopqr1112131415161718

stuvwxyz1920212223242526



We run the "Word mix" code , The output will be lie this


The nth word in the output should contain nth letter of each word in the given sentence. The letters of the output word should be in same order as the words in the given sentence. If a word in the given sentence doesn't have n-letters, you can skip it while considering the letters of the n-th word.


Ex: Input :: Welcome to your first problem


Output :: Wtyfp eooir luro crsb otl me em


Given a string, write a program to mirror the characters of the string in alphabetical order to create a secret message.


Note: Mirroring the characters in alphabetical order replacing the letters 'a' with 'z', 'b' with 'y', ... , 'z' with 'a'. You need to mirror both uppercase and lowercase characters. You can ignore mirroring for all characters that are not letters.


abcdefghijklmzyxwvutsrqpon nopqrstuvwxyzmlkjihgfedcba



LATEST TUTORIALS
APPROVED BY CLIENTS