Question
Exercises: code in python Write a program that prints all the numbers from 1 to 100. Your program should have much fewer than 100 lines
Exercises: code in python
Write a program that prints all the numbers from 1 to 100. Your program should have much fewer than 100 lines of code!
Starting with the word GENE1=ATGTTGATGTG, write a Python program that creates the new words GENE2, GENE3, GENE4 and GENE5 such that:
i. GENE2 only contains the last two letters of GENE1 ii. GENE3 only contains the first two letters of GENE1
iii. GENE4 only contains the letters at positions 2,4,6,8 and 10 in GENE1 iv. GENE5 only contains the first 3 and last 3 letters of GENE1
Suppose you have a Python program that read in a whole page from a book into an array PAGE, with each item of the array corresponding to a line. Add code to this program to create a new array SENTENCES that contains the same text, but now with each element in SENTENCES being one sentence.
Let d be a dictionary whose pairs key:value are country:capital. Write a Python program that prints the keys and values of d, with the keys sorted in alphabetical order. Test your program on d = {France:Paris,Belgium:Brussels,Mexico:Mexico City,Argentina:Buenos Aires,China:Beijing}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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