Wednesday, May 6, 2020

Some Coolest Python Program Code In 3 Lines

Python Program Code Just Under In 3 Line you can find all the python examples that can be written under 3 lines.

Some Coolest Python Program Code In 3 Lines
Some Coolest Python Program Code In 3 Lines


  • Python Program Code for Loader

Loader = "Loading"; count =5

print Loader,

while count !=0:

    import time

    print ".",

    count -=1

    time.sleep(0.3)

  • Python Program Code for Sort File In System

#!/usr/bin/env python

from __future__ import print_function  # Only for Python < 3; but harmless

import sys

from collections import Counter

 

data = Counter()

data.update([line.strip() for line in sys.stdin.readlines()])

print('\n'.join(['%s\t%s' % (y,x)  for x,y in data.most_common(20)]))


  • Python Program For Finding Sub String Of Given String

name = input().strip()

print("\n".join(name[i: i + j] for i in range(len(name)) for j in range(1, len(name) + 1 - i)))


  • Python Program Code For Scramble Word

scrmb = input(); with open('Database.txt','w') as lst:for word in lst.split():if len(scrmb) == len(word) and set(scrmb) == set(word):print(word)

0 Comments:

Post a Comment