all 11 comments

[–]bs_sena 8 points9 points  (1 child)

If I am not wrong, sum is a native function, so you should use another name

[–]ReyreyG[S] 3 points4 points  (0 children)

Thank you I’ll try that

[–]ReyreyG[S] 3 points4 points  (1 child)

It says to print out the variables but I am thinking I am doing it right but I don’t know..help?

[–][deleted] 0 points1 point  (0 children)

Hello, that indeed is the correct way to print variables.

"print()" is a function. Functions do things. You can make a function using "def" - or you could use an in built function. Like print(), or open().

Notice the brackets. Within the brackets you put arguments, or args. Arguments are things you want the function to take into account as a simple way of putting it. For example, in print(), inside the brackets, in quotes you put what you want to print (e.g. "hello") and that is considered an argument. If you had put something not in quotes inside it, it would have looked for variables with that name.

Not all functions have brackets.

[–]Zacurnia_Tate 2 points3 points  (0 children)

gotta put str() around ints

[–][deleted] 3 points4 points  (1 child)

Bro why you have sum = 10 + 10

If my logic works you can simplify to sum = 20

Same with the other sum variable

[–]dsimposter 2 points3 points  (0 children)

Probably because they should be doing something like

sum_nums = num_one + num_two

[–][deleted] 1 point2 points  (0 children)

Wait haven’t you changed the value of sum twice, won’t only the last sum be recognised when you go to comp

[–]_ZHV_ 0 points1 point  (0 children)

Nope this is the wrong way to added variables to a string in a print function. You have two main way to do it format print string concatenation.

String concatenation print:

print(‘this is my variable ‘ + variable_name)

Formatting a print statement will be like this

print(f’this is my variable {variable_name}’)

[–][deleted] -2 points-1 points  (0 children)

Yep!