Python Cycles Workshop

Задание 1

Given a dictionary:

pythontst = {
  '1': 'a',
  '2': 'b',
  '3': 'c',
  '4': 'd'
}

Loop through it and get the following list:

python[0, 'a', 1, 'b', 2, 'c']
Задание 2

Given an empty string, fill it with even numbers from 1 to 20 using a loop.

Задание 3

Print a column of odd numbers from 100 to 1 using a loop.

Задание 4

Fill a list with 10-th x's using a loop.

Задание 5

Fill the set using a loop with the first 10-th letters of the English alphabet.

Задание 6

Given a tuple of numbers, use a loop to print only those elements that are less than 10 and greater than 5.

Задание 7

Given a string, use a loop to check if it contains the letter 'c'.

Задание 8

Given a list of numbers, find the arithmetic mean of its elements.

Задание 9

Given a list of numbers, iterate through all of its elements until you find a positive number.

Задание 10

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.

Задание 11

From the dictionary in the previous task, output all user names in a column. Let them all be written with a capital letter.