Python Cycles Workshop
Given a dictionary:
tst = {
'1': 'a',
'2': 'b',
'3': 'c',
'4': 'd'
}
Loop through it and get the following list:
[0, 'a', 1, 'b', 2, 'c']
Given an empty string, fill it with even numbers from 1
to 20
using a loop.
Print a column of odd numbers from 100
to 1
using a loop.
Fill a list with 10
-th x's using a loop.
Fill the set using a loop with the first 10
-th letters of the English alphabet.
Given a tuple of numbers, use a loop to print only those elements that are less than 10
and greater than 5
.
Given a string, use a loop to check if it contains the letter 'c'
.
Given a list of numbers, find the arithmetic mean of its elements.
Given a list of numbers, iterate through all of its elements until you find a positive number.
Given a dictionary with the first name, last name, and age of five users, print all the elements of the dictionary as a key-value tuple.
From the dictionary in the previous task, output all user names in a column. Let them all be written with a capital letter.