Answered step by step
Verified Expert Solution
Question
1 Approved Answer
6. Write a program that displays the number of users on a social media application based on the following rules: If there is no
6. Write a program that displays the number of users on a social media application based on the following rules: If there is no one, return "no one online". If there is 1 person, return "user1 online". If there are 2 people, return "user1 and user2 online". If there are n>2 people, return the first two names and add "and n-2 more online". Initialize an array of size N with some username(s) (maybe none) and consider the above conditions. For example, if there are 5 users, the program displays: "user1, user2 and 3 more online" 6. Write a program that displays the number of users on a social media application based on the following rules: If there is no one, return "no one online". If there is 1 person, return "user1 online". If there are 2 people, return "user1 and user2 online". If there are n>2 people, return the first two names and add "and n-2 more online". Initialize an array of size N with some username(s) (maybe none) and consider the above conditions. For example, if there are 5 users, the program displays: "user1, user2 and 3 more online"
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Answer Certainly Below is a simple Python program that impl...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started