Question: 1 : create a string variable containing your name as one string = = = = = = = = = = = = =
: create a string variable containing your name as one string
: return just the rd character in your name. Do this
with other characters. For instance, return the first character, the rd character, etc.
: create a numeric variable with your age. Call the variable "myage".
It does not have to be your exact age.
: store your age in a STRING variable called "stringage".
: convert your age to a float and store the value in a variable called "floatage"
: create a tuple with five first names. Make sure one of the names is yours
Call the tuple "tfirstname"
: create a tuple of tuples. Your tuple should consist five records, each
containing one first name and one last name.
: create a list with five new tuples of first and last name,
print the first item in each tuple should print all first names
is omitted
is omitted
: Create a list with the even numbers between and including and
Give this list a variable name that is indicative of its contents.
thru can be done with one segment of code
: Loop through the list. Print the value of the current record each time you loop.
: if the value is greater than print "large value"
: if the value is not greater than print "small value"
sample output might be:
small value
small value
small value...
large value
large value
: after all items in the list are finished and the looping is over, print "processing complete".
: create a list of colors
: write a loop that will run one time for each item in the list. Create a variable that will act as a counter and will increment each time the loop runs.
For example, the first time the loop runs, this variable should be equal to Next time the loop runs, it should be equal to
Partial code is below:
colors red 'orange', 'green'
numbervariable
for i in colors:
printi
#increment numbervariable here
: print the color and number every time through the loop. Basically take item and add output to it
sample output might be:
purple
red
blue
: create a string variable that contains a four digit number such as
: multiply this number by and print the result. If you cannot multiply
by a string, create another variable that you can multiply by and convert
the string as necessary.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
