3
answers
0
watching
163
views
7 Mar 2018
Part (b) [4 MARKS] Consider this program in file words.py: Write what this program prints when you run it. Write one line per box. There are more boxes than you need; leave unused ones blank. def repeat_word(word, num_times): (str, int) -> str print(__name__) word = word * num_times print('Repeated word is:', word) return word if __name__ == '__main__': word = 'Yes' print (Original word is:', word) repeat_word(word, 3) print('New word is:', word) word = repeat_word(word, 2) + '!' print('New word is:', word)
Part (b) [4 MARKS] Consider this program in file words.py: Write what this program prints when you run it. Write one line per box. There are more boxes than you need; leave unused ones blank. def repeat_word(word, num_times): (str, int) -> str print(__name__) word = word * num_times print('Repeated word is:', word) return word if __name__ == '__main__': word = 'Yes' print (Original word is:', word) repeat_word(word, 3) print('New word is:', word) word = repeat_word(word, 2) + '!' print('New word is:', word)
3
answers
0
watching
163
views
For unlimited access to Homework Help, a Homework+ subscription is required.
22 Jun 2023
gloryolalere280Lv10
20 Nov 2022
Already have an account? Log in
Deanna HettingerLv2
7 Mar 2018
Already have an account? Log in