Write a method that iterates through a list (given as input) and removes all of the numbers that are divisible by 13. The method should print out the final list. Test out your method by calling it on a list of numbers.
Hint: use the special for loop you learned in class to iterate through the list! Write a program that has two functions, one to check if a triangle is valid, and the other to calculate its area.
Sample Output: Enter side 1: 3 Enter side 2: 4 Enter side 3: 5 The area is 6.0 Hints:
Write a program to check if a given word is a palindrome or not. A palindrome is any word that is spelled the same forward and backward.
Sample Output: Enter a word: racecar racecar is a palindrome Enter a word: lever lever is not a palindrome Hints
Write a program that will count the number of vowels in a word.
Hint: Use string index and the len() function. Write a program that checks if one of two numbers is 7, or if their sum or difference is 7.
See the image below for the answer to Week 2's problem. Please email your instructor if you need help or have questions (or put your questions in the check in submission form).
|