Menu

[solved]-1 Use String Concatenation Combine Firstname Lastname Variables Single Variable Called Ful Q39043309

1) Use string concatenation to combine the first_nameand last_name variables into a single variable called full_name.When you are finished, your output will match that underDesired Output.

# Create name variables
first_name = “Wade “
last_name = “Wilson”

# Create /full_name/ variable

# Pring /full_name/
print(full_name)

desired output:

Wade Wilson

2)

Toga parties are a lot of fun and they require repetitivechanting. Fortunately, Python has a repetition operator tohelp.

In this coding challenge, we are using the repetitionoperator to make the string blutarsky into a fun time. Whenyou are finished, your output should match the DesiredOutput.

# We have created our string
# Use the Repetition Operator to
# Make multiple copies
blutarsky = “Toga! “

# Print the results
print(blutarsky)

desired output:

Toga! Toga! Toga! Toga! Toga!

3)

We have a string called my_string. We want to test this stringto see if it meets specific criteria. Use the appropriate testingmethods to determine if my_string:

  1. Contains only letters
  2. Contains only letters and numbers
  3. Contains only uppercase letters (where there is at least oneletter)
  4. Contains only lowercase letters (where there is at least oneletter)
  5. Contains only whitespace characters
  6. Contains only numbers

Display the results. When finished, your output will match thatunder Desired Output.

# Create string
my_string = “0123a”

# Test if /my_string/ contains only
# alphabetic letters and
# least one character long

# Test if /my_string/ contains only
# letters and numbers and is at
# least one character long

# Test if /my_string/ contains only
# upper case letters and is at least one
# character long

# Test if /my_string/ contains only
# lower case letters and is at least one
# character long

# Test if /my_string/ contains only
# whitespace and is at least one
# character long

# Test if /my_string/ contains only
# numbers and is at least one
# character long
desired output:

FalseTrueFalseTrueFalseFalse

Expert Answer


Answer to 1) Use string concatenation to combine the first_name and last_name variables into a single variable called full_name. W… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *