Answer:
lst = []
n = int(input("Input an array size for you words array: "))
print("Now please enter " + str(n) + " words")
max = 0
min = 1000
index_min = 0
index_max = 0
for i in range(n):
s = input("Input a word: ")
lst.append(s)
if len(s) >= max:
max = len(s)
index_max = i
if len(s) <= min:
min = len(s)
index_min = i
print("The longest word is :" + lst[index_max])
print("The shortest word is :" + lst[index_min])
Explanation:
Create an empty list, lst
Get the size from the user
Create a for loop that iterates "size" times
Inside the loop, get the strings from the user and put them in the lst. Find the longest and shortest strings and their indices using if structure.
When the loop is done, print the longest and shortest
Answer:
Be Alert to Impersonators. Safely Dispose of Personal Information. Encrypt Your Data. keep Passwords Private. Don't Overshare on Social Networking Sites.
Use Security Software. Avoid Phishing Emails.
Be Wise About Wi-Fi.
Answer:
The answer to this question is given below in the explanation section
Explanation:
There are different skills or passions that you can use to earn handsome money.
Being a computer student, I have a passion for web development. I have skills in Wordpress, HTML and PHP. I used these skills to develop static and dynamic websites for clients and for companies.
Even, If I will not get a job in some companies and I want to work online according to my own pace and time. I can use freelancing, and doing the online job and providing services to clients online, I can earn more money than doing a traditional job.
Answer:
There is not a reason for the two methods to be private unless you want to only allow objects of the class Rational to have access to these methods. Perhaps your professor has a particular reason for requiring it to be set up as such.
Explanation:
The use of the private space simply restricts access to either variables or methods contained within the space to the class object that is associated with the variable or methods.
The use of the public space allows the method or variable to be accessed from anywhere within the program.
Note, if using class inheritance, classes that inherit from the Rational class will not be able to access the private functions.