Variables Problems

Problem 1

print("Problem 1")

Assign the variable name to your name and combine it with the words, “Welcome to my program!”.

Problem 2

print("Problem 2")

Create variables for name, street address, city, state and zip code.

Print your name and mailing address as it would appear on the outside of an envelope.

Problem 3

print("Problem 3")

In this problem, you're going to write a paragraph about yourself.

Create the following variables and assign each to a sentence about yourself.

  • sentence1

  • sentence2

  • sentence3

  • sentence4

  • sentence5

Print the paragraph.

Problem 4

print("Problem 4")

The 8 parts of speech are a noun, verb, adjective, pronoun, preposition, conjunction and interjection.

part of speech

meaning

noun

a word (other than a pronoun) used to identify any of a class of people, places, or things ( common noun ), or to name a particular one of these ( proper noun ).

verb

a word used to describe an action, state, or occurrence, and forming the main part of the predicate of a sentence, such as hear, become, happen.

adjective

a word or phrase naming an attribute, added to or grammatically related to a noun to modify or describe it.

adverb

a word or phrase that modifies or qualifies an adjective, verb, or other adverb or a word group, expressing a relation of place, time, circumstance, manner, cause, degree, etc. (e.g., gently, quite, then, there ).

preposition

a word governing, and usually preceding, a noun or pronoun and expressing a relation to another word or element in the clause, as in “the man on the platform", "she arrived after dinner", "what did you do it for?"

conjunction

a word used to connect clauses or sentences or to coordinate words in the same clause (e.g. and, but, if).

interjection

an exclamation, (e.g. ah!, dear me! ).

Create the following variables for each part of speech and assign appropriate values.

  • noun

  • verb

  • adjective

  • adverb

  • preposition

  • conjunction

  • interjection

Print each variable on a single line.

Problem 5

print("Problem 5")

Print a sentence about yourself using at least 4 variables from Problem 4.

Problem 6

print("Problem 6")

Assign new values to the variables you created in Problem 5 about your friend. Print the new sentence.

Problem 7

print("Problem 7")

How much money do you have? Assign this value to the variable money.

Print a sentence using the variable money.

Last updated