Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Solve in python. i did the first part (task 1), how can i use this to do task 2? word = 'coronavirus' letters = 'abcdefghijklmnopqrstuvwxyz'

Solve in python. i did the first part (task 1), how can i use this to do task 2?
word = 'coronavirus'
letters = 'abcdefghijklmnopqrstuvwxyz'
for letter in letters:
if letter in word:
print(letter, 'contains', word)
image text in transcribed
image text in transcribed
image text in transcribed
The first case of COVID-19 was identified in December 2019. Today, many vaccines are available, but during the initial outbreak of the coronavirus, many different medications were used to treat it. In this task, you will be writing a single program test1.py that performs various operations on the names of some of these medications. Step-by-step 1. Have your program check the word 'coronavirus' itself and report what unique letters it contains. Your program must check the word 'coronavirus' and determine its unique letters automatically. You may not tell your program what its unique letters are. In other words, you will not get credit if your program includes a line like unique = 'acinorsuv' or unique = 'cornavius'. This also applies to step 2 below. 2. In this step, your program will search for common letters in the names of some medications that were initially used to treat the coronavirus. - Take each unique letter in the word 'coronavirus' and report whether each letter also exists in each medication from the following list of medications: guercetin, hydroxychloroquine, ivermectin, azithromycin. Example of running the final program coronavirus contains a coronavirus contains c coronavirus contains i coronavirus contains n coronavirus contains o coronavirus contains r coronavirus contains s coronavirus contains u coronavirus contains v a is in coronavirus and also in azithromycin c is in coronavirus and also in quercetin c is in coronavirus and also in hydroxychloroquine c is in coronavirus and also in ivermectin c is in coronavirus and also in azithromycin i is in coronavirus and also in quercetin i is in coronavirus and also in hydroxychloroquine i is in coronavirus and also in ivermectin i is in coronavirus and also in azithromycin n is in coronavirus and also in quercetin n is in coronavirus and also in hydroxychloroquine n is in coronavirus and also in ivermectin n is in coronavirus and also in azithromycin - is in coronavirus and also in hydroxychloroquine 0 is in coronavirus and also in azithromycin r is in coronavirus and also in quercetin r is in coronavirus and also in hydroxychloroquine r is in coronavirus and also in ivermectin r is in coronavirus and also in azithromycin u is in coronavirus and also in quercetin u is in coronavirus and also in hydroxychloroquine v is in coronavirus and also in ivermectin In step 2, you can reuse your code from step 1 to get the unique letters in 'coronavirus'. Then, for each of those letters, you can go through the list of medications and check whether each medication contains that letter. The lines output by your program do not have to be in the same order shown above. However, the output lines corresponding to each step must be listed together, no lines should be duplicated, and no lines should be missing. Please remember the note about REASONABLE PROGRAMS in the syllabus! For example, whenever you have repetition in your program, Unit 1 introduces the for statement, which you can use in your program instead of repeating nearly identical lines many times. So, if you were to submit a program that did repeat many similar lines, and the tasks done by those lines could be replaced by a for statement, that would not be a reasonable program, and you would not get any credit! For now, please only use what you learned in Unit 1 and nowhere else. Do not use any Python features covered in later units, and do not use any Python features you may have read about online or in other resources. If you are confused about how to do something, email your instructor and ask for help

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books