String exercises in Python with solutions
#python #stringspython #stringexercises
String exercises:
' This is the rat, that ate the malt that lay in the house that Jack built. '
1. How many characters are there in the string? Count in two ways – using a function and using a for loop.
2. Check if there are the following characters in this string:
,
u
j
.
d
3. How many letters
a
f
i
spaces
are there in this string?
4. Print out the following words:
malt
house
Jack
5. Replace all the words:
that by the word sure
the comma by an exclamation mark
6. Delete all the spaces from the beginning and the end of the string.
7. Check if after deleting the spaces the new string starts with the word
This
8. Print out the new string in all upper case.
9. Print out the new string in all lower case.
10. Make only the first letter of the new string uppercase, all other letters stay lower case.
11a. Manage the following strings to get the output:
Start to code right now!
The strings:
'now'
'to'
'Start'
'right'
'!'
'code'
Feel free to add some strings or slightly modify the given strings.
11b. Manage the following variables to get the output 33
x = 4
y = '29'
12. Compare the following strings in two ways - with the len() function and without using the len() function:
a)
'allosaurus'
'dimertodon'
b)
'amargasaurus'
'minmi'
c)
'[@] 123/abc]'
'[@] 123!abc]'
d)
'If I rise on the wings of the dawn, if I settle on the far side of the sea’
'If I rise on the wings of the dawn, if I settle on the far side of the Sea’
5:40 - check your answers
Python course #2 in English 12
Python programming language course in English
#pythonexercises #pythonstringexercises #pythontasks #python程式設計語言 #python程式設 #程式設計語言 #程式設
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «String exercises in Python with solutions», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.