Q. Write a program that counts the number of characters up to the first $ in a text file.
Answer :-
file = open("pathwalla.txt","r") data = file.read() for i in range( len( data ) ): if data [ i ] == "$" : break print( "Total number of characters up to the first $ before = ",i )
Content in pathwalla.txt :-
This is Pathwalla website
here you can get all answer
Related to CS and $ IP
Ok3
Thank you
here you can get all answer
Related to CS and $ IP
Ok3
Thank you
Output :-
Total number of characters up to the first $ before = 72
>>>
>>>
Welcome : )
ReplyDeleteIs there any explanation video available for this program?
ReplyDeleteThanks
ReplyDeleteWelcome : )
DeleteOutput??
ReplyDeleteOk..
DeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )