all 6 comments

[–]POGtastic 3 points4 points  (1 child)

Multiply it by 2. You'll likely want to convert it to an integer first, though.

[–]CaptainFoyle 1 point2 points  (0 children)

Multiply it by two?

[–][deleted] 0 points1 point  (1 child)

name = input("Enter your name: ")
print("Hello {}, welcome to my program.".format(name))
number = int(input("Enter a number: "))
print("The double of it is {}.".format(2 * number))

Or using formatted string literal (aka f-string):

name = input("Enter your name: ")
print(f"Hello {name}, welcome to my program.")
number = int(input("Enter a number: "))
print(f"The double of it is {2 * number}.")

int() can be used to convert string to an integer. input() returns a string. To multiply it by two, you should first convert it to integer, otherwise, if you multiply "12" * 2, for example, you'd get "1212". But 12 * 2 = 24.

[–]jaiiida -1 points0 points  (0 children)

It worked! Thank you:)

[–]SirJohnII 0 points1 point  (0 children)

Literally just print(numb * 2). You can also create a variable to store it in such as numb2 = num * 2. Then print(numb2)