├── week6 ├── lines │ ├── test.py │ └── lines.py ├── shirt │ ├── after.jpg │ ├── before1.jpg │ ├── before2.jpg │ ├── before3.jpg │ ├── muppets.zip │ ├── shirt.png │ └── shirt.py ├── pizza │ ├── sicilian.csv │ ├── regular.csv │ └── pizza.py └── scourgify │ ├── scourgify.py │ ├── after.csv │ └── before.csv ├── week0 ├── playback │ └── playback.py ├── einstein │ └── einstein.py ├── indoor │ └── indoor.py ├── faces │ └── faces.py └── tip │ └── tip.py ├── Final project ├── logout_icon.png ├── spotify_logo.png ├── requirements.txt ├── test_project.py ├── README.md └── project.py ├── week8 ├── shirtificate │ ├── shirtificate.pdf │ ├── shirtificate.png │ └── shirtificate.py ├── seasons │ ├── test_seasons.py │ └── seasons.py └── jar │ ├── jar.py │ └── test_jar.py ├── week4 ├── emojize │ └── emojize.py ├── game │ └── game.py ├── bitcoin │ └── bitcoin.py ├── figlet │ └── figlet.py ├── adieu │ └── adieu.py └── professor │ └── professor.py ├── week7 ├── um │ ├── test_um.py │ └── um.py ├── response │ └── response.py ├── numb3rs │ ├── test_numb3rs.py │ └── numb3rs.py ├── watch │ └── watch.py └── working │ ├── test_working.py │ └── working.py ├── week2 ├── camel │ └── camel.py ├── twttr │ └── twttr.py ├── coke │ └── coke.py ├── nutrition │ └── nutrition.py └── plates │ └── plates.py ├── week1 ├── bank │ └── bank.py ├── deep │ └── deep.py ├── interpreter │ └── interpreter.py ├── extensions │ └── extensions.py └── meal │ └── meal.py ├── week5 ├── test_twttr │ ├── test_twttr.py │ └── twttr.py ├── test_bank │ ├── bank.py │ └── test_bank.py ├── test_plates │ ├── test_plates.py │ └── plates.py └── test_fuel │ ├── test_fuel.py │ └── fuel.py ├── week3 ├── grocery │ └── grocery.py ├── fuel │ └── fuel.py ├── taqueria │ └── taqueria.py └── outdated │ └── outdated.py ├── LICENSE └── README.md /week6/lines/test.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | print() -------------------------------------------------------------------------------- /week0/playback/playback.py: -------------------------------------------------------------------------------- 1 | print(input("Enter some text \n").replace(" ","...")) -------------------------------------------------------------------------------- /week6/shirt/after.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aryanranderiya/cs50-python/HEAD/week6/shirt/after.jpg -------------------------------------------------------------------------------- /week6/shirt/before1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aryanranderiya/cs50-python/HEAD/week6/shirt/before1.jpg -------------------------------------------------------------------------------- /week6/shirt/before2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aryanranderiya/cs50-python/HEAD/week6/shirt/before2.jpg -------------------------------------------------------------------------------- /week6/shirt/before3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aryanranderiya/cs50-python/HEAD/week6/shirt/before3.jpg -------------------------------------------------------------------------------- /week6/shirt/muppets.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aryanranderiya/cs50-python/HEAD/week6/shirt/muppets.zip -------------------------------------------------------------------------------- /week6/shirt/shirt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aryanranderiya/cs50-python/HEAD/week6/shirt/shirt.png -------------------------------------------------------------------------------- /week0/einstein/einstein.py: -------------------------------------------------------------------------------- 1 | m = int(input("Enter mass: ")) 2 | c = 300000000 3 | print ("E is", m * pow(c, 2)) 4 | -------------------------------------------------------------------------------- /Final project/logout_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aryanranderiya/cs50-python/HEAD/Final project/logout_icon.png -------------------------------------------------------------------------------- /Final project/spotify_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aryanranderiya/cs50-python/HEAD/Final project/spotify_logo.png -------------------------------------------------------------------------------- /Final project/requirements.txt: -------------------------------------------------------------------------------- 1 | cachetools==4.2.2 2 | Pillow==8.3.2 3 | requests==2.26.0 4 | spotipy==2.18.0 5 | tk==0.1.0 6 | -------------------------------------------------------------------------------- /week8/shirtificate/shirtificate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aryanranderiya/cs50-python/HEAD/week8/shirtificate/shirtificate.pdf -------------------------------------------------------------------------------- /week8/shirtificate/shirtificate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aryanranderiya/cs50-python/HEAD/week8/shirtificate/shirtificate.png -------------------------------------------------------------------------------- /week4/emojize/emojize.py: -------------------------------------------------------------------------------- 1 | import emoji 2 | 3 | inputstring = input("Input: ") 4 | print("Output: ", emoji.emojize(inputstring, language='alias')) 5 | 6 | -------------------------------------------------------------------------------- /week7/um/test_um.py: -------------------------------------------------------------------------------- 1 | from um import count 2 | 3 | def test() : 4 | assert count("yummy") == 0 5 | assert count("hi um hi") == 1 6 | assert count("UM.... HI") == 1 -------------------------------------------------------------------------------- /week7/response/response.py: -------------------------------------------------------------------------------- 1 | import validators 2 | 3 | if validators.email(input("What's your email address?")) : 4 | print("Valid") 5 | else : 6 | print("Invalid") 7 | -------------------------------------------------------------------------------- /week6/pizza/sicilian.csv: -------------------------------------------------------------------------------- 1 | Sicilian Pizza,Small,Large 2 | Cheese,$25.50,$39.95 3 | 1 item,$27.50,$41.95 4 | 2 items,$29.50,$43.95 5 | 3 items,$31.50,$45.95 6 | Special,$33.50,$47.95 7 | -------------------------------------------------------------------------------- /week6/pizza/regular.csv: -------------------------------------------------------------------------------- 1 | Regular Pizza,Small,Large 2 | Cheese,$13.50,$18.95 3 | 1 topping,$14.75,$20.95 4 | 2 toppings,$15.95,$22.95 5 | 3 toppings,$16.95,$24.95 6 | Special,$18.50,$26.95 7 | -------------------------------------------------------------------------------- /week2/camel/camel.py: -------------------------------------------------------------------------------- 1 | name = input("Enter your name: ") 2 | 3 | for letter in name: 4 | 5 | if letter.isupper() : letter = "_" + letter 6 | 7 | print (letter.lower(), end="") 8 | 9 | print() 10 | 11 | -------------------------------------------------------------------------------- /week7/um/um.py: -------------------------------------------------------------------------------- 1 | import re 2 | import sys 3 | 4 | 5 | def main(): 6 | print(count(input("Text: "))) 7 | 8 | 9 | def count(s): 10 | return len(re.findall(r"\bum\b",s.lower())) 11 | 12 | if __name__ == "__main__": 13 | main() -------------------------------------------------------------------------------- /week1/bank/bank.py: -------------------------------------------------------------------------------- 1 | greeting = input("Input a Greeting for $$$:") 2 | 3 | if greeting.lower().strip().startswith("hello"): 4 | print("$0") 5 | elif greeting.lower().strip().startswith("h"): 6 | print("$20") 7 | else: 8 | print("$100") 9 | -------------------------------------------------------------------------------- /week5/test_twttr/test_twttr.py: -------------------------------------------------------------------------------- 1 | from twttr import shorten 2 | 3 | 4 | def test(): 5 | assert shorten("aryan") == "ryn" 6 | assert shorten("cs50") == "cs50" 7 | assert shorten("AryAn") == "ryn" 8 | assert shorten("test.test") == "tst.tst" -------------------------------------------------------------------------------- /week0/indoor/indoor.py: -------------------------------------------------------------------------------- 1 | # Fetch input from the user and store in string variable 'text' 2 | text = input("Type some UPPERCASE text to use your indoor voice! \n") 3 | 4 | # Convert uppercase characters to lowercase and print output 5 | print (text.lower()) -------------------------------------------------------------------------------- /week0/faces/faces.py: -------------------------------------------------------------------------------- 1 | def convert(a): 2 | a = a.replace(":)","🙂") 3 | a = a.replace(":(","🙁") 4 | print (a) 5 | 6 | def main(): 7 | text = input("Input some text with emoticons: ") 8 | convert(text) 9 | 10 | main() 11 | 12 | 13 | -------------------------------------------------------------------------------- /week2/twttr/twttr.py: -------------------------------------------------------------------------------- 1 | text = input("Input:") 2 | 3 | vowel_list = ["a", "e", "i", "o", "u"] 4 | 5 | for l in text: 6 | for _ in vowel_list: 7 | if l.lower() == _: 8 | l = "" 9 | 10 | print(l, end="") 11 | 12 | print() 13 | -------------------------------------------------------------------------------- /week1/deep/deep.py: -------------------------------------------------------------------------------- 1 | answer = input("What is the Answer to the Great Question of Life, the Universe, and Everything?").strip().lower() 2 | 3 | if answer == "42" or answer == "forty-two" or answer == "forty two": 4 | print("Yes") 5 | else: 6 | print("No") 7 | -------------------------------------------------------------------------------- /week7/numb3rs/test_numb3rs.py: -------------------------------------------------------------------------------- 1 | from numb3rs import validate 2 | 3 | def test() : 4 | assert validate("127.0.0.1") == True 5 | assert validate("255.255.255.255") == True 6 | assert validate("1.2.3.1000") == False 7 | assert validate("cat") == False 8 | assert validate("1.999.999.999") == False 9 | assert validate("512.512.512.512") == False -------------------------------------------------------------------------------- /week2/coke/coke.py: -------------------------------------------------------------------------------- 1 | amount = 50 2 | print("Amount due: ", amount) 3 | 4 | while True: 5 | 6 | money = int(input("Insert Coin: ")) 7 | 8 | if money == 25 or money==10 or money==5: 9 | amount = amount - money 10 | 11 | if amount <= 0: 12 | print("Change Owed:", abs(amount)) 13 | break 14 | 15 | print("Amount Due:", amount) -------------------------------------------------------------------------------- /week1/interpreter/interpreter.py: -------------------------------------------------------------------------------- 1 | expression = input ("Expression:") 2 | 3 | num1, op, num2 = expression.split(" ") 4 | 5 | if op == "+": 6 | print (float(num1) + float(num2)) 7 | 8 | if op == "-": 9 | print (float(num1) - float(num2)) 10 | 11 | if op == "*": 12 | print (float(num1) * float(num2)) 13 | 14 | if op == "/": 15 | print (float(num1) / float(num2)) -------------------------------------------------------------------------------- /week5/test_bank/bank.py: -------------------------------------------------------------------------------- 1 | def main(): 2 | print("$",value(input("Input a Greeting for $$$:"))) 3 | 4 | 5 | def value(greeting): 6 | if greeting.lower().strip().startswith("hello"): 7 | return 0 8 | elif greeting.lower().strip().startswith("h"): 9 | return 20 10 | else: 11 | return 100 12 | 13 | 14 | if __name__ == "__main__": 15 | main() 16 | -------------------------------------------------------------------------------- /week7/watch/watch.py: -------------------------------------------------------------------------------- 1 | import re 2 | import sys 3 | 4 | def main(): 5 | print(parse(input("HTML: "))) 6 | 7 | 8 | def parse(s): 9 | 10 | if match := re.search(r"