PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, September 15, 2022

[FIXED] How to print brackets in python

 September 15, 2022     brackets, printing, python     No comments   

Issue

i want to print "(" in python

print "(" + var + ")"

but it says:

TypeError: coercing to Unicode: need string or buffer, NoneType found

can somebody help me? that cant be too hard... -.-


Solution

Using string formatting:

foo = 'Hello'
print('({})'.format(foo))


Answered By - aldeb
Answer Checked By - Willingham (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing