File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ Donkey SANU Donkey Donkey
2+ Donkey Donkey Hassan
3+ Donkeyman Donkey KIng Donkey
4+ Donkey Hello world!
5+ Donkey Hockey
6+ wakey wakey Donkey
7+ Raja Donkey
Original file line number Diff line number Diff line change 1+ def generate_table (n ):
2+ table = ""
3+ for i in range (1 ,11 ):
4+ table += f"{ n } x { i } = { n * i } \n "
5+
6+ with open (f"tables/table_of_{ n } .txt" , "w" ) as f :
7+ f .write (table )
8+
9+ for i in range (2 ,21 ):
10+ generate_table (i )
Original file line number Diff line number Diff line change 1+ words = ["bad" , "donkey" ]
2+
3+ with open ("words.txt" ) as f :
4+ content = f .read ()
5+
6+ for word in words :
7+ content = content .replace (word , "#" * len (word ))
8+
9+ with open ("words.txt" , "w" ) as f :
10+ f .write (content )
Original file line number Diff line number Diff line change 1+ with open ("donkey.txt" ) as f :
2+ x = f .read ()
3+
4+ y = x .replace ("Donkey" , "###" )
5+
6+ with open ("donkey.txt" , "w" ) as f :
7+ f .write (y )
8+
Original file line number Diff line number Diff line change 1+ The bad donkey kicked the bad
2+ bucket, while another donkey
3+ stubbornly ignored
4+ the bad weather and the bad apples.
You can’t perform that action at this time.
0 commit comments