Forum Discussion
Dicken
Post Prodigy
7 days agopasting code
I have just asked a question, and used the code tags, as you would for 'forum', but on viewing it does not look very copy / paste friendly, which was the point of sharing, is there a better way o...
- 6 days ago
This is an unfortunate issue with the updated forum.
I (and others) posted feedback here, and it will hopefully being addressed:
tayloramy
Super User
6 days agoHi Dicken​,
This has been fixed now.
See sample code below
# Ask the user for their name
name = input("Enter your name: ")
# Ask for numbers (and convert the text input into floating-point numbers)
num1 = float(input("Enter first number: "))
num2 = float(input("Enter second number: "))
# Perform basic math
total_sum = num1 + num2
# Print the results using an f-string (formatted string literal)
print(f"Hello, {name}!")
print(f"The sum of {num1} and {num2} is {total_sum}")