How to do GOOD right justify in python? the string before str.rjust() has various length -


सही बस

इस तरह मैं इसे अब मुद्रित कर रहा हूं, लेकिन मैं चाहता हूं कि सभी नंबर एक ही स्तर पर हों, लेकिन मैं ऐसा नहीं कर सकता, क्योंकि ईमेल की अलग-अलग लंबाई - hotmail.com, mail.com ईमेल: ईमेल में ईमेल के लिए: current_email = email.split ("@

मेरे कोड:

  def count_domains (तिथि, ईमेल): प्रिंट (तारीख) my_emails = ", 2) [1] my_emails.append (current_email) unique_emails = सूची (सेट (my_emails)) श्रेणी में x (len (unique_emails)): प्रिंट (str (unique_emails [x])। Rjust (2) +": "+ Str (my_emails.count (unique_emails [x]))। Rjust (4))  

इस तरह से कुछ के बारे में:

  प्रिंट ((str (unique_emails [x]) + ":") .ljust (20) + str (my_emails.count (unique_emails [x] ))। Rjust (4))  

Comments

Popular posts from this blog

Folder list php -

objective c - How to open front/back camera at the same time in iOS developing? -

GO: Serve static pages -