Ask the user to enter 4 words. Add the words to a list (turn them all lowercase). Show the list.
Make a second list, that has the original words in reverse order
Note: use of reverse() or reversed() python functions is not permitted.
Sample Run:
Please enter 4 words
Word 1: One
Word 2: Two
Word 3: Three
Word 4: Four
Original list of words = ['one', 'two', 'three', 'four']
List of words in reverse = [ 'four' , 'three', 'two', 'one' ]
Write a program that makes a list of 10 random letters from A to C.
(Hint use the ASCII table) and a loop that happens 10 times)
The program counts how many times each Letter appears in the list
Use python function count() is not permitted.
Sample Run:
Generating a list of 10 random letters A,B,C:
[A, B, C, B, A, C, A, B, C, C]
The letter A appears: 3 times
The letter B appears: 3 times
The letter C appears: 4 times
Ask the user to enter a sentence, where everything is in lower case.
Your program capitalizes the first letter of every word.
Sample Run:
Please enter a sentence: this is a sentence
Your sentence is: This Is A Sentence.
Write the definitions and calls for the following functions:
The use of any built-in python function to aid you solve these is not permitted! You must be able to write these basic function using simple loops and selection. The sum.py program below shows you an example to get you started.
Define and test a function is_palindrome() that recognizes palindromes
Palindrome is a word that looks the same written backwards.
For example, is_palindrome("radar") returns True.
print ( is_palindrome("radar") ) # Shows True
Write the following two functions, and test them (show output):
Function 1:
Write a function which takes 2 float PARAMETERS distance and time.
The functions computes and SHOWS the speed = distance/ time rounded to 2 values to the right of the decimal point, for example: speed = 634.16
Function 2:
Write a function which takes 2 PARAMETERS num1, num2.
The function then RETURNS the bigger of the 2 numbers
Write a program that accepts the lengths of three sides of a triangle as an input from the user: A, B, C
1) Validate the user input so that the user can only enter positive values for sides A, B, C. All three must be true:
2) The program output should first check if the shape is a triangle. A shape is a triangle if the sum of two side lengths is greater than the third side. All 3 must be true:
3) If it is a triangle, then indicate whether or not the triangle is:
Set up the program so the user can choose to repeat the program, if desired.
Test your program for the 4 types of triangles, and submit the output with your C program.