0

my code:

import math

var = float(input())
SqrtVar = math.sqrt(var)
print("sqrt(", var, ") =", SqrtVar)

this prints out for input 5:

sqrt( var ) = *something or other*
how to remove the spaces after and before the var??
martineau
  • 119,623
  • 25
  • 170
  • 301
  • `print(f'sqrt({var}) = {SqrtVar}')` – Mouad Dec 09 '21 at 16:59
  • pass a single string argument to print() using one of the two forms of variable insertion: ```print("sqrt(%s) = %s' % (var, SqrtVar))``` or the f-string syntax ```print(f'sqrt({var}) = {SqrtVar}')``` – AbbeGijly Dec 09 '21 at 17:00
  • thank you coders it's very appreciated and my problem is solved – bblank_ Dec 09 '21 at 17:11

0 Answers0