Question

using python Write a program that displays all of states in the U.S. and display each...

using python Write a program that displays all of states in the U.S. and display each state that begins with the letter A.

Homework Answers

Answer #1
Thanks for the question. Below is the code you will be needing. Let me know if you have any doubts or if you need anything to change. 

If you are satisfied with the solution, please leave a +ve feedback : ) Let me know for any help with any other questions.

Thank You!
===========================================================================

states = ['Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware',
          'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana',
          'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana',
          'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina',
          'North Dakota', 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode Island', 'South Carolina',
          'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', 'West Virginia',
          'Wisconsin', 'Wyoming']

print('States starting with the letter A')
for state in states:
    if state[0] =='A':
        print(state)

==================================================================

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
write a python program to display the product table of 7, from7 to 7
write a python program to display the product table of 7, from7 to 7
Write a program in python to display all the consonant in the user input. E.g. user...
Write a program in python to display all the consonant in the user input. E.g. user input: Hello Good Day to you. Output: consonant H = 1 consonant l = 2 consonant G = 1   consonant d = 1 consonant D = 1 etc
Problem 2: Write a program that reads an integer and displays, using asterisks, a filled diamond...
Problem 2: Write a program that reads an integer and displays, using asterisks, a filled diamond of the given side length. For example, if the side length is 5, the program should display c++ look like a diamond
write a simple program that displays 4 python primitive data types sizes in bytes run the...
write a simple program that displays 4 python primitive data types sizes in bytes run the program on a command prompt CMD. attach a photo of the source file in the text editior and the excutable on CMD ex; the size of int in bytes is ... the size of floot in bytes is ... the size of string in bytes is ... the size of char in bytes is ....
in java Write a program that displays all the leap years, eight per line, from 101...
in java Write a program that displays all the leap years, eight per line, from 101 to 2500, separated by one space. Meanwhile display the number of leap years in this period of year.
Using python, write the program below. Program Specifications: You are to write the source code and...
Using python, write the program below. Program Specifications: You are to write the source code and design tool for the following specification: A student enters an assignment score (as a floating-point value). The assignment score must be between 0 and 100. The program will enforce the domain of an assignment score. Once the score has been validated, the program will display the score followed by the appropriate letter grade (assume a 10-point grading scale). The score will be displayed as...
Write a Java program to display a letter grade based on an actual grade. USING ECLIPSE...
Write a Java program to display a letter grade based on an actual grade. USING ECLIPSE IDE A = 90-100 B = 80-89 C = 70-79 D = 60-69 F = less than 60 The program needs to do the following: 1. Create a short integer to store a grade. (See Week 3 - Things to Know - Java Data Types ) 2. Prompt for a grade ( 0-100). 3. Based on the grade given, use IF statements to display...
Hello, I am trying to write a program in python that will determine if a sentence...
Hello, I am trying to write a program in python that will determine if a sentence has every letter in the alphabet, regardless if it is upper or lower case. The program needs to indicate if all letters are present or not, and print out the missing letters if there are any. Thanks for any help in advance.
Write a Python program using that takes a number as input and then prints if the...
Write a Python program using that takes a number as input and then prints if the number is even or odd. The program should use a function isEven that takes a number as a parameter and returns a logical value true if the number is even, false otherwise.
Write a Java program that reads words from a text file and displays all the words...
Write a Java program that reads words from a text file and displays all the words (duplicates allowed) in ascending alphabetical order. The words must start with a letter. 1. You must use one of following Concrete class to store data from the input.txt file. Vector, Stack, ArrayList, LinkedList 2. To sort those words, you should use one of existing interface methods available in Collection or List class.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT