This file contains 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
hrs = int(input("Enter Hours:")) | |
rate = input("Enter rate") | |
rate = float(rate) | |
if hrs>40 : | |
print(rate*40 + (hrs-40)*1.5*rate) |
This file contains 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") | |
try: | |
score = float(score) | |
except : | |
print("Please Enter Valid Input") | |
quit() | |
if score >= 0.9 : | |
print("A") | |
elif score>=0.8: | |
print("B") |
This file contains 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(h,r): | |
if h>40 : | |
return 40 * r + (h-40)*r*1.5 | |
hrs = input("Enter Hours:") | |
rate = input("Enter rate") | |
try : | |
hrs = float(hrs) | |
rate = float(rate) | |
except : |
This file contains 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 | |
while True: | |
num = input("Enter a number: ") | |
if num == 'done': | |
break | |
try : | |
num = int(num) | |
if (largest==None) : | |
largest = num |
This file contains 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" | |
start = text.find('0') | |
end = text[start:29] | |
end = float(end) | |
print(end) |
This file contains 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
fname = input("Enter file name: ") | |
try : | |
fh = open(fname) | |
except: | |
print(fname," files does not exit .Enter valid file names") | |
quit() | |
for line in fh : | |
line =line.rstrip()# for removing newline from the letter | |
print(line.upper()) |
This file contains 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
fname = input("Enter file name: ") | |
fh = open(fname) | |
count = 0 | |
total = 0.0 | |
for line in fh: | |
if not line.startswith("X-DSPAM-Confidence:") : continue | |
count = count + 1 | |
line = line[20:] | |
line = float(line) | |
total = total+line |
This file contains 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
#include<stdio.h> | |
#include<cs50.h> | |
#include<math.h> | |
int main(void) | |
{ float dollars=0; | |
do | |
{ | |
dollars = get_float("Chang owned:"); | |
}while(dollars<0); |
This file contains 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
#include<stdio.h> | |
#include<cs50.h> | |
#include<string.h> | |
#include<math.h> | |
void Count(string text); | |
void print(double index); | |
double Letter = 0.0; | |
double Sentence = 0.0; | |
double words =1.0; | |
int main(void) |
This file contains 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
fname = input("Enter file name: ") | |
try: | |
fh = open(fname) | |
lst = list() | |
for line in fh: | |
lst.append( line.split()) | |
newlist = sum(lst,[]) | |
newlist.sort() | |
print([newlist[i] for i in range(len(newlist)) if i == newlist.index(newlist[i])]) | |
except : |
OlderNewer