+ 3
Arguments and Type
def print_with_exclamation(word): print(word + 3) print_with_exclamation(2) print_with_exclamation(6) print_with_exclamation(1) Output : 5 9 4 So how can we change code to get output : 23 63 13 Could you answer this please? :)
7 ответов
+ 5
This might help:
def x(word) :
print(str(word)+str(3))
x(3)
output : 33
+ 4
Gizem Güleli
You mean changing it into a string?
you could use str(number) to change it into a string
+ 4
Your Welcome 😉
+ 3
It seems that you want to append '3' at the end of an inputted number?
Just change it to
def print_with_exclamation(word)
print(10*word+3)
+ 2
Hello there. In order to get these outputs you need to call the function with the number needed to get the sum with 3. For example if you want 23 as the result your code should be
print_with_exclamation(20), so the function executes the following command 20+3 and returns 23. Think likewise for the rest of your questions. :)
+ 2
Actually this is not the thing that i want 😓 let me try to ask like that ;
Is there a way to run 2,6,1 like word not like integer to get that output ?
By the way sorry my English and bad explanation
0
Yes right 👍🏻 Thank u so much it will help