0

How do i change line before a variable in Python?

I tried 'print("\n" + a)' , 'print(\n + a)', and a few others like that Edit: I got it to work with 'print("\n" + str(a))'. Is there an easier way of doing this?

23rd Jul 2019, 4:21 AM
TheBrickler
1 Answer
+ 2
With the newer version of Python, you could just use an f string to display the variable: print(f"\n{str(a)}")
23rd Jul 2019, 5:32 AM
Faisal
Faisal - avatar