Question: 1. Write a python program to take a single number (X) as an input and determine (units are arbitrary): a. The area of a circle

1. Write a python program to take a single number (X) as an input and determine (units are arbitrary): a. The area of a circle with radius X b. The circumference of a circle with radius X c. The area of a square with sides of X d. X factorial (X!).

2. Write a Python program to calculate number of days between two dates. Sample dates : (2014, 7, 2), (2014, 7, 11) Expected output : 9 days

3. Given a DNA sequence, write a Python program that outputs the number and proportion of each base, including ambiguous ones (n). Make sure your code can handle upper and lower case. Now add some code to output the reverse complement of the sequence - try not to use any pre-made reverse-compl. function.

4. The number of salamanders marked at a series of sampling sites has been counted by your field crew and entered into the following list. The first item in each sublist is an alphanumeric code for the site and the second value is the number of salamanders banded. Cut and paste the list into your assignment and then answer the following questions by printing them to the screen. I am looking for the python commands that you type to get these answers.

data = [['A1', 28], ['A2', 32], ['A3', 1], ['A4', 0], ['A5', 10], ['A6', 22], ['A7', 30], ['A8', 19], ['B1', 145], ['B2', 27], ['B3', 36], ['B4', 25], ['B5', 9], ['B6', 38], ['B7', 21], ['B8', 12], ['C1', 122], ['C2', 87], ['C3', 36], ['C4', 3], ['D1', 0], ['D2', 5], ['D3', 55], ['D4', 62], ['D5', 98], ['D6', 32]]

a. How many sites are there? b. How many salamanders were counted at the 7th site? c. How many salamanders were counted at the last site? d. What is the total number of salamanders counted across all sites? e. What is the average number of salamanders per site?

f. What is the total number of salamanders counted on sites with codes beginning with C? (dont just identify this sites by eye, in the real world there could be hundreds or thousands of sites)

5. Write a python program to count the number of times the word "the" appears in a piece of text. Sample input: " The big fat cat jumped over Theodore, the lazy panther" output: Number of occurrences of "the": 2

6. Given a list of numbers, output the sum of all odd numbers and the sum of all even numbers. Your code should be able to handle floating point numbers by regarding the number before the decimal point, but the sum should include the entire number. Thus, 3.44 is odd and 6.7775 is even. sample input: [23,22.7,4,5,67.3,34,3,4,1,1,2] output: sum of evens is: 66.7 sum of odds is: 100.3

7. Write a python script to print all the prime numbers up to 100.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!