DEV Community

Discussion on: New Beginnings

Collapse
cjsmocjsmo profile image
Charlie J Smotherman

Running a python program is easy. Place your code in a file lets say "test.py".
Now to run this code in the terminal run "python3 test.py" and that's it.

Although this code is perfectly fine

print("Your band name could be " + street + " " + pet)

the more pythonic way would be

print("Your band name could be {} {}".format(street, pet))

Happy Coding

Collapse
cjsmocjsmo profile image
Charlie J Smotherman

You can also use "join"

ace = " ".join(("Your band name could be", street, pet))
print(ace)
Enter fullscreen mode Exit fullscreen mode
Collapse
jdc1492 profile image
Jonathan Cohen Author

That’s clever as well. Thanks so much for taking the time to read the post and comment!