Starting from:

$30

CSC401–Introduction to Programming 1 Solved

Your assignment is to solve the following problems (A – E) in Python. You can add all of these to the same python file, edited and executed via the Python IDLE interface.

Part A) 

1. Write the Python expression to convert 22° Celsius to degrees Fahrenheit. Save the converted value in a variable. Print the variable.

Part B) 

1. Write the Python statement that will determine if the word ‘Pseudohypoparathyroidism’ contains the string “popar”. Print true if it does it or False if it does not.

Part C) 

1.       Create a new list containing only the word ‘Pear

2.       Append (one at a time) the following strings to the list: ‘Apple, ‘Orange, ‘Raspberry, ‘Kiwi’, ‘Fig’

3.       Print the list

4.       Print the number of strings in the list

5.       Print the longest string in the list

6.       Print the shortest string in the list

Part D) 

1.       Create a list with the following values: 70, 92, 68, 67, 89, 75, 89, 77, 81, 60, 81, 90

2.       Print the list

3.       Print the number of values

4.       Print the min value in the list

5.       Print the max value in the list

6.       Print the average of the list values

Part E) 

1.       Create a list with the following names: [‘Vito, ‘Michael, ‘Kay’, ‘Fredo, ‘Connie’, ‘Luca’]

2.       Then write the python code that puts the list in alphabetical order, and then print the first item in the sorted list and the last item in the sorted list.

 

More products