Вы находитесь на странице: 1из 3

1)

x = ['ab', 'cd']
for i in x:
i.upper()
print(x)

2)
x = ['ab', 'cd']
for i in x:
x.append(i.upper())
print(x)

3)
i = 1
while True:
if i%3 == 0:
break
print(i)
i + = 1

4)
i = 1
while True:
if i%0O7 == 0:
break
print(i)
i += 1

5)
i = 5
while True:
if i%0O11 == 0:
break
print(i)
i += 1

6)
i = 5
while True:
if i%0O9 == 0:
break
print(i)
i += 1

7)
i = 1
while True:
if i%2 == 0:
break
print(i)
i += 2

8)
i = 2
while True:
if i%3 == 0:
break
print(i)
i += 2

9)
i = 1
while False:
if i%2 == 0:
break
print(i)
i += 2

10)
True = False
while True:
print(True)
break

11)
k = [print(i) for i in my_string if i not in "aeiou"]

12)
k = [print(i) for i in my_string if i not in "aeiou"]
print(k)
13)

my_string = "hello world"


k = [(i.upper(), len(i)) for i in my_string]
print(k)

14) convert following comprehension in to while loop logic

list_1 = [expr(i) for i in list_0 if func(i)

15) [i**+1 for i in range(3)]; print(x);

16) print([i.lower() for i in "HELLO"])

17) print([i+j for i in "abc" for j in "def"])

18) print([i+j for i in "abc" for j in "def"])

Вам также может понравиться