We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,492 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

How do you input % as regular text ?

hi, my code involves something like this:

IP = "123.123.123.123"

string = "Your IP is %s and it's 100% correct" % IP

The IDLE thinks the second % is a operator and I don't know how to make it as a regular text. please help.

2
Contributors
2
Replies
36 Minutes
Discussion Span
1 Year Ago
Last Updated
3
Views
jxj123
Newbie Poster
2 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Did you try a double percent?
%%

thines01
Postaholic
Team Colleague
2,433 posts since Oct 2009
Reputation Points: 447
Solved Threads: 408
Skill Endorsements: 7

Did you try a double percent?
%%

That works perfectly. thank you so much thines01 !!!!

jxj123
Newbie Poster
2 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page generated in 0.0606 seconds using 2.67MB