CSE 1284: Introduction to Computer Programming home > 3.1: String basics
CHALLENGE
ACTIVITY
3.1.2: String basics.
zyBooks catalog ? H
547726.3512336 qx3zqy7
Jump to level 1
Read string person_name from input. Then, read num_coins from input, using int() to convert the input read to an integer.
?Click here for example
Ex: If the input is:
Joy
15
then the output is:
Joy lost 3 coins, so 12 remain
1
2 person_name = Joy
3 num_coins = 15
4
5 print(person_name, 'lost 3 coins, so', num_coins - 3, 'remain')
1
2
3
4