python - What is wrong with my print function? -


i in introduction anaconda class , need write program determine how many times dice roll(s) land on amount of faces. however, cannot print answer correctly.

image1

image2

your problem print statement. try print string called end string, , forth. think want end end-of-line character.

instead of printing like

print("a string" end "another string" end "a third string") 

use

print("a string\n" "another string\n" "a third string") 

note "\n" end-of-line character in python. code uses feature of python can combine string literals placing them next each other. let lets see individual lines more clearly. code failed because tried string variable, namely end, , did not define variable.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -