About beginner python programming: - Imagine that you want to send a congratulations message and would like to repeat those congratulations many times times in the message. Something like “Happy Birthday!! Happy Birthday!! Happy Birthday!! ..." until full your friend's screen. You can write once and copy and paste. Then you notice, there in the middle of the way, that you typed wrong...Ouch! Now that you know how to use Python to make it work for you, do a function that receives as input a text and the desired number of repetitions and returns a string composed of n repetitions of this text. - so I know how to input a specific word in python and multiply it by a number but not how to input a string as a variable (which can be any word, text, expression) and multiply it.
About beginner python
-
Imagine that you want to send a congratulations message and would like to repeat those congratulations many times
times in the message. Something like “Happy Birthday!! Happy Birthday!! Happy Birthday!! ..." until full
your friend's screen. You can write once and copy and paste. Then you notice, there in the middle
of the way, that you typed wrong...Ouch! Now that you know how to use Python to make it work for you,
do a function that receives as input a text and the desired number of repetitions and returns a
string composed of n repetitions of this text.
-
so I know how to input a specific word in python and multiply it by a number but not how to input a string as a variable (which can be any word, text, expression) and multiply it.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images