This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| xh = input("Enter Hours:") | |
| xr = input("Enter Rate:") | |
| xp = float(xh)*float(xr) | |
| print("Pay:",xp) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| xh = input("Enter Hours:") | |
| xr = input ("Enter Rate:") | |
| fh = float (xh) | |
| fr = float (xr) | |
| if fh > 40: | |
| reg = fh*fr | |
| otp = (fh-40)*(fr*0.5) | |
| xp = reg + otp | |
| else: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| score = input("Enter Score: ") | |
| x = float(score) | |
| if x >=0.9: | |
| print("A") | |
| elif x >=0.8: | |
| print("B") | |
| elif x >=0.7: | |
| print("C") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def computepay(hours, rate): | |
| xh=float(hours) | |
| xr=float(rate) | |
| if xh < 40: | |
| pay = xh*xr | |
| return pay | |
| else: | |
| pay=(xr*40)+(xh-40)*(xr*1.50) | |
| return pay |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| largest = None | |
| smallest = None | |
| the_list = [] | |
| while True: | |
| num = input() | |
| if num == "done":break | |
| if len(num) < 1: break | |
| try: | |
| number = int(num) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| text = "X-DSPAM-Confidence: 0.8475"; | |
| x = text.find(" ") | |
| y = text[x:] | |
| fy=float(y) | |
| print(fy) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Use words.txt as the file name | |
| input("Enter File Name") | |
| fhand = open ("words.txt") | |
| for line in fhand: | |
| line = line.rstrip() | |
| line = line.upper() | |
| print(line) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Use the file name mbox-short.txt as the file name | |
| fname = input("Enter file name: ") | |
| fhand = open(fname) | |
| count = 0 | |
| for line in fhand: | |
| if line.startswith("X-DSPAM-Confidence:") : | |
| count = count + 1 | |
| total = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fhand = open("romeo.txt") | |
| lst = list() | |
| for line in fhand: | |
| line = line.rstrip() | |
| line = line.split() | |
| for i in line: | |
| if i not in lst: | |
| lst.append(i) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fhand = open("mbox-short.txt") | |
| count = 0 | |
| for line in fhand: | |
| line = line.rstrip() | |
| if line == "": continue | |
| words = line.split() | |
| if words[0] !="From": continue | |
| print(words[1]) |
OlderNewer