Question: 1 : create a string variable containing your name as one string = = = = = = = = = = = = =

1: create a string variable containing your name as one string
=====================
2: return just the 3rd character in your name. Do this
with 3 other characters. For instance, return the first character, the 3rd character, etc.
=====================
3: create a numeric variable with your age. Call the variable "myage".
It does not have to be your exact age.
=====================
4: store your age in a STRING variable called "stringage".
=====================
5: convert your age to a float and store the value in a variable called "floatage"
=====================
6: create a tuple with five first names. Make sure one of the names is yours
Call the tuple "tfirstname"
=====================
7: create a tuple of tuples. Your tuple should consist five records, each
containing one first name and one last name.
=====================
8: create a list with five new tuples of first and last name,
print the first item in each tuple (should print all first names)
=======================
(9 is omitted)
=====================
(10 is omitted)
=====================
11: Create a list with the even numbers between 0 and 20, including 0 and 20.
Give this list a variable name that is indicative of its contents.
=====================
(12 thru 15 can be done with one segment of code)
12: Loop through the list. Print the value of the current record each time you loop.
=====================
13: if the value is greater than 10, print "large value"
=====================
14: if the value is not greater than 10, print "small value"
sample output might be:
0
small value
2
small value
3
small value...
...11
large value
12
large value
=====================
15: after all items in the list are finished and the looping is over, print "processing complete".
=====================
16: create a list of 10 colors
=====================
17: 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 1. Next time the loop runs, it should be equal to 2.)
Partial code is below:
colors =('red', 'orange', 'green')
numbervariable =1
for i in colors:
print(i)
#increment numbervariable here
=====================
18: print the color and number every time through the loop. (Basically, take item 17 and add output to it.)
sample output might be:
purple 1
red 2
blue 3...
=====================
19: create a string variable that contains a four digit number such as "1776"
=====================
20: multiply this number by 4 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!