├── 05.More Python - Microsoft ├── manage.txt ├── output2.txt ├── output.txt ├── test.txt ├── 08.using_with.py ├── 02.basic_class.py ├── 07.working_with_files_read.py ├── 07.working_with_files_manage.py ├── 06.managing_file_path.py ├── 07.working_with_files_write.py ├── 06.managing_file_files.py ├── 03.properties_class.py └── 06.managing_file_directories.py ├── 01.Complete Python Bootcamp - JP ├── MyMainPackage │ ├── __init__.py │ ├── SubPackage │ │ ├── __init__.py │ │ └── mysubscript.py │ └── some_main_script.py ├── newfile.txt ├── helloworld.py ├── mymodule.py ├── Cap.py ├── sweetfile.txt ├── myprogram.py ├── demo.py ├── test.py ├── words.txt └── flowers.txt ├── 17.Python for Automation ├── 00.data │ ├── AfterOrganized │ │ ├── DOCUMENTS │ │ │ └── Random.txt │ │ ├── AUDIO │ │ │ └── Random.m4a │ │ ├── IMAGES │ │ │ └── Random.jpeg │ │ └── VIDEOS │ │ │ └── Random.mov │ ├── fail_list.txt │ └── pass_list.txt ├── 01.Automate File Folder Terminal │ ├── hello_world.py │ ├── 02.terminal_command.py │ └── 01.file_automation.py └── 04.Automating with APIs │ ├── 02.working_with_API_keys.py │ └── 01.calling_APIs.py ├── 18.Web Scraping with Python Scrapy - RM ├── 03_Advanced_Techniques │ ├── form │ │ ├── form │ │ │ ├── __init__.py │ │ │ ├── spiders │ │ │ │ └── __init__.py │ │ │ ├── items.py │ │ │ └── pipelines.py │ │ └── scrapy.cfg │ ├── news_scraper │ │ ├── news_scraper │ │ │ ├── __init__.py │ │ │ ├── spiders │ │ │ │ └── __init__.py │ │ │ └── items.py │ │ └── scrapy.cfg │ └── news_scraper_challenge │ │ ├── news_scraper_challenge │ │ ├── __init__.py │ │ ├── spiders │ │ │ └── __init__.py │ │ ├── items.py │ │ └── pipelines.py │ │ └── scrapy.cfg ├── 04_Acting_Human │ ├── locations │ │ ├── locations │ │ │ ├── __init__.py │ │ │ ├── spiders │ │ │ │ └── __init__.py │ │ │ ├── items.py │ │ │ └── pipelines.py │ │ └── scrapy.cfg │ └── profiles │ │ ├── profiles │ │ ├── __init__.py │ │ ├── spiders │ │ │ └── __init__.py │ │ ├── items.py │ │ └── pipelines.py │ │ └── scrapy.cfg ├── 01_Basic_WebScraping │ └── ietf_scraper │ │ ├── ietf_scraper │ │ ├── __init__.py │ │ ├── spiders │ │ │ └── __init__.py │ │ ├── items.py │ │ └── pipelines.py │ │ └── scrapy.cfg └── 02_Learning_to_Crawl │ └── article_crawler │ ├── article_crawler │ ├── __init__.py │ ├── spiders │ │ └── __init__.py │ └── items.py │ └── scrapy.cfg ├── 03.Complete Python Developer - Zero to Mastery - AN ├── 08.Modules In Python │ ├── shopping │ │ ├── __init__.py │ │ └── shopping_cart.py │ ├── module_utilities.py │ ├── builtin_modules_2.py │ ├── builtin_modules.py │ ├── useful_modules2.py │ └── module_example.py ├── 10.File IO │ ├── test.txt │ ├── translated_one.txt │ ├── source.txt │ └── file_test.py ├── 12.Testing │ ├── test_manual_run.txt │ └── addition.py ├── 15.Web Development with Python │ ├── static │ │ ├── style.css │ │ └── assets │ │ │ ├── favicon.ico │ │ │ ├── images │ │ │ ├── profil.jpg │ │ │ ├── space.jpg │ │ │ ├── work001-01.jpg │ │ │ ├── work001-02.jpg │ │ │ ├── work001-03.jpg │ │ │ ├── work001-04.jpg │ │ │ ├── work01-hover.jpg │ │ │ ├── work02-hover.jpg │ │ │ └── work03-hover.jpg │ │ │ └── apple-icon-180x180.png │ ├── database.csv │ ├── database.txt │ └── requirements.txt ├── 02.Python Basics II │ ├── cleancode.py │ ├── range.py │ ├── 12. Exercise Tricky Counter.py │ ├── truth_falsey.py │ ├── enumerate.py │ ├── 8. Exercise Logical Operators.py │ ├── docstring.py │ ├── ternary_operator.py │ ├── scope and global keywords.py │ ├── is vs ==.py │ ├── 34.1 Exercise Repl.py │ ├── nonlocal keyword.py │ ├── iterables.py │ ├── 30.1 Solution Repl.py │ └── parameters arguments default keywords.py ├── 01.Python Basics │ ├── matrix.py │ ├── 28.1 Exercise Repl.py │ ├── list_unpacking.py │ ├── 13.1 Exercise Repl.py │ ├── 23. Exercise Type Conversion.py │ ├── list_methods2.py │ ├── list_patterns.py │ ├── 25. Exercise Password Checker.py │ ├── dictionaries_keys.py │ ├── sets.py │ ├── list_methods3.py │ ├── 9.1.Exercise Operator Precedence.py │ ├── 19.1 Exercise Repl.py │ ├── tuple.py │ ├── dictionaries.py │ ├── 27.1 Exercise Repl.py │ └── 18.1 Exercise Repl.py ├── 13.Scripting with Python │ ├── Email Project │ │ ├── mail.properties │ │ └── email_content.html │ ├── Twilio Project │ │ └── twilio.properties │ ├── Twitter Bot Project │ │ └── twitter.properties │ ├── PDFs Processing │ │ ├── pdfs │ │ │ ├── wtr.pdf │ │ │ ├── dummy.pdf │ │ │ ├── twopage.pdf │ │ │ └── processed │ │ │ │ ├── tilt.pdf │ │ │ │ ├── merged.pdf │ │ │ │ ├── super.pdf │ │ │ │ └── watermarked_super.pdf │ │ ├── pdf_merger.py │ │ ├── pdf_processor.py │ │ └── pdf_dynamic_merger.py │ └── Image Processing │ │ ├── astro │ │ ├── astro.jpg │ │ └── processed │ │ │ └── thumbnail.jpg │ │ ├── pokedex │ │ ├── pikachu.jpg │ │ ├── squirtle.jpg │ │ ├── bulbasaur.jpg │ │ ├── charmander.jpg │ │ └── processed │ │ │ ├── small_squ.png │ │ │ ├── blurred_squ.png │ │ │ ├── crooked_squ.png │ │ │ ├── cropped_squ.png │ │ │ └── greyscale_squ.png │ │ └── image_astro.py ├── 14.Web Scraping │ └── hacker_news.html ├── 04.Advanced Python Functional Programming │ ├── filter.py │ ├── map.py │ ├── map_practice.py │ ├── 13.1 Exercise Repl.py │ ├── filter_practice.py │ ├── zip.py │ ├── reduce.py │ ├── 10.1 Exercise Repl.py │ ├── lambda.py │ ├── list_comprehension.py │ ├── set_comprehension.py │ └── dictionary_comprehension.py ├── 06.Advanced Python Error Handling │ ├── error_handling2.py │ ├── error_handling.py │ └── error_handling3.py ├── 17.Machine Learning and Data Science │ ├── iris_flowers.joblib │ ├── ML_SmartyBrain_Project │ │ ├── house.jpg │ │ ├── giraffe.jpg │ │ ├── godzilla.jpg │ │ └── squeezenet_weights_tf_dim_ordering_tf_kernels.h5 │ └── machine_learning_101.txt ├── 09.Debugging In Python │ └── debugging_test.py ├── 03.Advanced Python Object Oriented Programming │ ├── 23. MRO - Method Resolution Order.py │ ├── mro example.py │ ├── 21.1 Exercise Repl.py │ └── OOP_skeleton.py ├── 11.Regular Expressions │ ├── email_validation.py │ ├── regular_expression1.py │ ├── password_checker.py │ └── regular_expression2.py ├── 07.Advanced Python Generators │ ├── fibonacci_numbers.py │ ├── generator.py │ └── custom_range_generator.py ├── 05.Advanced Python Decorators │ ├── decorators3.py │ ├── higher_order_functions.py │ ├── decorators.py │ └── decorator4.py └── 16.Automation Testing │ └── automation.py ├── 04.100 Python Exercises Evaluate and Improve Your Skills - AS ├── Exercise 26-50 │ ├── output_45 │ │ ├── a.txt │ │ ├── b.txt │ │ ├── c.txt │ │ ├── d.txt │ │ ├── e.txt │ │ ├── f.txt │ │ ├── g.txt │ │ ├── h.txt │ │ ├── i.txt │ │ ├── j.txt │ │ ├── k.txt │ │ ├── l.txt │ │ ├── m.txt │ │ ├── n.txt │ │ ├── o.txt │ │ ├── p.txt │ │ ├── q.txt │ │ ├── r.txt │ │ ├── s.txt │ │ ├── t.txt │ │ ├── u.txt │ │ ├── v.txt │ │ ├── w.txt │ │ ├── x.txt │ │ ├── y.txt │ │ └── z.txt │ ├── 37_words2.txt │ ├── 36_words1.txt │ ├── output_44.txt │ ├── output_43.txt │ ├── formula.jpg │ ├── 29_spherprt.gif │ ├── output_41.txt │ ├── exercise_30.py │ ├── exercise_31.py │ ├── exercise_42.py │ ├── exercise_33.py │ ├── exercise_26.py │ ├── exercise_48.py │ ├── exercise_39.py │ ├── exercise_46.py │ └── exercise_28.py ├── Exercise 76-100 │ ├── 92_files │ │ ├── file1.txt │ │ ├── file2.txt │ │ ├── file3.py │ │ ├── file4.py │ │ └── file5.txt │ ├── 93_files │ │ └── subdirs │ │ │ ├── level11 │ │ │ ├── 1.txt │ │ │ ├── 2.txt │ │ │ └── 4.py │ │ │ └── level12 │ │ │ ├── 6.txt │ │ │ └── level121 │ │ │ ├── 3.txt │ │ │ ├── 5.py │ │ │ └── 6.py │ ├── users.txt │ ├── 97_file │ │ └── 97_file.txt │ ├── 96_file │ │ └── 96_file.txt │ ├── 95_file │ │ └── 95_file.txt │ ├── 94_file │ │ ├── 94_urls.txt │ │ └── corrected_urls.txt │ ├── database │ │ ├── database.db │ │ ├── database1.db │ │ ├── 31.originalDB │ │ │ └── database1.db │ │ └── ten_more_countries.txt │ ├── exercise95.py │ ├── exercise93.py │ ├── exercise89.py │ ├── exercise96.py │ ├── exercise87.py │ ├── exercise92.py │ └── exercise90.py ├── Exercise 51-75 │ ├── output │ │ ├── output_73.csv │ │ └── output_74.csv │ ├── json file added employees_58.png │ ├── exercise_60.py │ ├── exercise_61.py │ ├── exercise_58.py │ ├── exercise_62.py │ └── exercise_51.py └── Exercise 01-25 │ ├── exercise_15.py │ ├── exercise_03.py │ ├── exercise_23.py │ ├── exercise_02.py │ ├── exercise_12.py │ ├── exercise_16.py │ ├── exercise_18.py │ ├── exercise_17.py │ ├── exercise_05.py │ ├── exercise_24.py │ ├── exercise_19.py │ ├── exercise_06.py │ ├── exercise_20.py │ ├── exercise_08.py │ ├── exercise_11.py │ ├── exercise_25.py │ ├── exercise_01.py │ └── exercise_09.py ├── Python DB-API └── Python - PostgreSQL │ ├── catalog │ └── README.txt │ ├── tournament │ └── tournament.sql │ └── forum │ ├── solution │ └── forumdb_initial.py │ └── forum.sql ├── 02.Modern Python 3 Bootcamp - CS ├── 31.01.CSV File │ ├── files │ │ └── cats.csv │ ├── fighters.csv │ ├── fighters_with_pipe.csv │ ├── capatalized_fighters.csv │ ├── csv_dict_reader.py │ ├── heightconverted_fighters.csv │ ├── csv_reader_with_specific_delimiter.py │ ├── csv_reader.py │ └── csv_writer.py ├── 10.Looping │ ├── emoji_art.py │ ├── repeater.py │ ├── kid.py │ └── unlucky_numbers.py ├── 31.02.Pickling │ ├── frozencat.json │ └── pets.pickle ├── 30.File IO │ ├── story_reader.py │ └── newstory.txt ├── 07.Variables and Strings │ ├── none.py │ └── km_to_miles_converter_project.py ├── 35.Python + SQL │ ├── dog_db.db │ ├── friends │ │ └── my_friends.db │ └── dog.sql ├── 32.Web Scraping │ └── blog_data.csv ├── 13.Lists Comprehensions │ ├── nested_list.py │ ├── list_comprehensions.py │ ├── list_comprehensions_with_logic.py │ └── exercise.py ├── 08.Boolean and Conditional Logic │ ├── is_vs_=.py │ └── truthiness.py ├── 23.HTTP_Requests │ ├── joke_request.py │ └── joke_request_params.py └── 06.Numbers, Operators, and Comments │ └── operators.py ├── 11.Learning Python - JM ├── 01.Basic │ ├── helloworld.py │ ├── variables.py │ └── conditionals.py ├── 03.Working with Files │ ├── testzip.zip │ ├── testarchive.zip │ ├── test.txt │ └── test2.txt ├── using_timeit.py ├── 04.Working with Web Data │ ├── samplexml.xml │ └── inetdata.py ├── range.py ├── regular_exp.py ├── map.py └── enumerate.py ├── 13.Learning Python Libraries ├── 01.Learning Python Standard Library - KH │ ├── 03.Python Input Output │ │ ├── data │ │ │ ├── scores.txt │ │ │ ├── test.txt │ │ │ └── data.zip │ │ ├── 02_input_output.py │ │ ├── 05_iterative_files.py │ │ └── 06_temp_file.py │ ├── 04.Python Date Time HTML │ │ ├── data │ │ │ └── test.html │ │ ├── 01_getting_current_time.py │ │ ├── 04_timer.py │ │ └── 02_format_date_time.py │ ├── 01.Python Built In │ │ ├── 01_05_Min_Max.py │ │ ├── 01_04_Range_List.py │ │ ├── 01_03_CalculatingLength.py │ │ └── 01_08_TypeFunctions.py │ └── 02.Python Math │ │ ├── 01_trigonometry_ceiling_floor_constant.py │ │ └── 02_factorial_sqaure_GCD.py └── 03.Python Essential Libraries - JM │ └── REST client extension test │ └── test.http ├── 19.XML and JSON ├── 01.XML Essential │ ├── img │ │ ├── DOM1.png │ │ ├── DOM2.png │ │ ├── DOM3.png │ │ ├── DOM4.png │ │ ├── DOM5.png │ │ ├── DTD1.png │ │ ├── DTD2.png │ │ ├── DTD3.png │ │ ├── DTD4.png │ │ ├── DTD5.png │ │ ├── DTD6.png │ │ ├── DTD7.png │ │ ├── DTD8.png │ │ ├── DTD9.png │ │ ├── XML1.png │ │ ├── XML10.png │ │ ├── XML11.png │ │ ├── XML12.png │ │ ├── XML13.png │ │ ├── XML14.png │ │ ├── XML15.png │ │ ├── XML16.png │ │ ├── XML2.png │ │ ├── XML3.png │ │ ├── XML4.png │ │ ├── XML5.png │ │ ├── XML6.png │ │ ├── XML7.png │ │ ├── XML8.png │ │ ├── XML9.png │ │ ├── XSLT1.png │ │ ├── XSLT2.png │ │ ├── XSLT3.png │ │ ├── XMLtypes.png │ │ ├── X_Path.png │ │ ├── X_Path0.png │ │ ├── XML_namespace1.png │ │ ├── XML_namespace2.png │ │ ├── XML_namespace3.png │ │ └── X_Path_Example.png │ ├── 07_xslt_examples │ │ ├── photos │ │ │ ├── candles.jpg │ │ │ ├── teacup.jpg │ │ │ ├── teapot_bone.jpg │ │ │ ├── teapot_white.jpg │ │ │ └── javaco_tea_logo.gif │ │ ├── 01_01_simpletransform.xml │ │ └── 01_03_simpletransform.css │ ├── 03_working_with_XML │ │ ├── FirstXMLFile.css │ │ ├── FirstXMLFile.xml │ │ └── businesscard.xml │ ├── 04_manipulating_xml_with_DOM │ │ └── javaco_tea_logo.gif │ ├── 05_xpath │ │ └── businesscard.xml │ ├── 09_schema │ │ └── businesscard.xml │ └── 08_document_type_definition_dtd │ │ ├── businesscard.dtd │ │ └── businesscard_dtd_as_external.xml └── 02.API Documentation with JSON and XML │ ├── img │ ├── XML1.png │ ├── XML2.png │ ├── XML3.png │ ├── XML4.png │ ├── XML5.png │ ├── XML6.png │ ├── XML7.png │ ├── schema.png │ └── namespace.png │ ├── 02_JSON │ ├── weather_oneday.json │ ├── meeting.json │ └── menu.json │ ├── 01_Markdown │ ├── peanut_butter.md │ └── markdown_exercise.md │ └── 03_XML │ └── weather_oneday.xml ├── 10.Python Code Challenges ├── Level_02 │ ├── rooster2.wav │ ├── test │ │ ├── test_dict.txt │ │ └── test_dict.pickle │ └── 04.alarm.py └── Level_01 │ ├── create_largest_possible_number.py │ ├── 04_sort_words.py │ ├── is_armstrong_number.py │ └── 02_is_prime.py ├── 14.Learning Python Generators - JMQ ├── 02.Using Generator as Context Manager │ ├── 03.Use the yield value │ │ └── text_log │ └── 01.Building Context Manager using yield │ │ ├── context_manager_framework.py │ │ └── incrementer.py ├── 01.Generator Functions and Expressions │ ├── 02.Generator Expression │ │ ├── 02.even_integers_generator_expression.py │ │ ├── 03_convert_to_upper_generator_expression.py │ │ ├── 01_list_comprehension_vs_generator_expression.py │ │ └── 04_reverse_uppercase_generator_expression.py │ ├── 01.Build Generator Function │ │ ├── even_integers_function.py │ │ └── even_integers_generator.py │ ├── 05.Build Generator Pipeline │ │ └── 01.longest_name.py │ ├── 04.Fibonacci Sequence Challenge │ │ ├── fibonacci_generator_short_version.py │ │ └── fibonacci_generator.py │ └── 03.Use Generator Object │ │ └── generator_usage_style.py └── 03.Coroutines │ ├── 01.Create a Corountine │ └── coroutine_example.py │ ├── 04.Coroutine Pipelines │ └── coroutine_decorator_example.py │ └── 03.Consume Value in send method │ └── coroutine_decorator_example.py ├── 07.Data Structures & Algorithms ├── Big O │ ├── O(log_n).py │ ├── O(1)_Constant_Time.py │ ├── O(n)_Linear_Time.py │ └── O(n2).py ├── Foundation Algorithms - Lynda │ ├── 03.Recursion │ │ ├── Fibonacci_sum_with_recursion.py │ │ ├── list_length.py │ │ ├── countdown.py │ │ └── Fibonacci_series_with_loop.py │ ├── 02.Data Structures │ │ ├── stack.py │ │ └── queue_with_deque.py │ ├── 01.Common Algorithms │ │ └── gcd.py │ └── 05.Searching │ │ └── search_unordered_list.py └── Data Structure & Algorithms - Udacity │ └── course_excitement.py ├── 15.Python Decorators - JM ├── 05.Decorators in Real World │ └── flask_fib.py ├── 01.Functions │ ├── fibonacci.py │ └── fibonacci_three.py └── 03.Decorators with Arguments │ └── decorator_with_args_kwargs.py ├── 16.Functional Programming with Python - SW ├── 01.First Class Functions │ ├── basic.py │ ├── returning_functions_basic.py │ ├── passing_functions_as_arg_calculation.py │ ├── basic_fetch_data.py │ ├── closure_basic_print.py │ ├── passing_functions_as_arg_combine_name.py │ ├── divide_safe_checker_with_higher_order_functions.py │ └── closure_basic_counter.py ├── 03.Advanced Functional Concepts │ ├── recursion_count_down.py │ ├── partial_and_currying_with_functools.py │ ├── recursion_count_up.py │ └── basic_currying.py └── 02.Python - Functional Parts │ ├── lambda.py │ ├── mapping.py │ ├── filtering.py │ └── reducing.py ├── 06.Core Python - Getting Started ├── wasteland.txt └── banner.py ├── 12.Python Object Oriented Programming - JM ├── 02.Inheritance and Composition │ └── composition.png └── 01.OOP │ └── definition.py ├── 00.Python Mini Projects ├── 03.Weight on different planets │ └── planets.properties ├── 05.Email Slicer │ └── email_slicer.py └── 08.Baby Conversation Simulator │ └── baby.py ├── JSON with Python └── states.py ├── 09.Automate the Boring Stuffs with Python Projects - AS ├── Chapter 4 – Lists │ └── comma_code.py ├── Chapter 3 – Functions │ └── collatz_sequence.py └── Chapter 5 – Dictionaries and Structuring Data │ └── character_counter.py └── API HTTP Request ├── books_api_request.py └── sample_api_request.py /05.More Python - Microsoft/manage.txt: -------------------------------------------------------------------------------- 1 | cool! -------------------------------------------------------------------------------- /05.More Python - Microsoft/output2.txt: -------------------------------------------------------------------------------- 1 | Hello again ! -------------------------------------------------------------------------------- /01.Complete Python Bootcamp - JP/MyMainPackage/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /01.Complete Python Bootcamp - JP/newfile.txt: -------------------------------------------------------------------------------- 1 | Hi I am new file -------------------------------------------------------------------------------- /01.Complete Python Bootcamp - JP/MyMainPackage/SubPackage/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05.More Python - Microsoft/output.txt: -------------------------------------------------------------------------------- 1 | Hello World! 2 | Richard 3 | Vivian -------------------------------------------------------------------------------- /17.Python for Automation/00.data/AfterOrganized/DOCUMENTS/Random.txt: -------------------------------------------------------------------------------- 1 | Random -------------------------------------------------------------------------------- /01.Complete Python Bootcamp - JP/helloworld.py: -------------------------------------------------------------------------------- 1 | print('hello world') 2 | print("Richard") -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/03_Advanced_Techniques/form/form/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/04_Acting_Human/locations/locations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/04_Acting_Human/profiles/profiles/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /01.Complete Python Bootcamp - JP/mymodule.py: -------------------------------------------------------------------------------- 1 | def myfunc(): 2 | print("just my function.") -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/08.Modules In Python/shopping/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/output_45/a.txt: -------------------------------------------------------------------------------- 1 | a -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/output_45/b.txt: -------------------------------------------------------------------------------- 1 | b -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/output_45/c.txt: -------------------------------------------------------------------------------- 1 | c -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/output_45/d.txt: -------------------------------------------------------------------------------- 1 | d -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/output_45/e.txt: -------------------------------------------------------------------------------- 1 | e -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/output_45/f.txt: -------------------------------------------------------------------------------- 1 | f -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/output_45/g.txt: -------------------------------------------------------------------------------- 1 | g -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/output_45/h.txt: -------------------------------------------------------------------------------- 1 | h -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/output_45/i.txt: -------------------------------------------------------------------------------- 1 | i -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/output_45/j.txt: -------------------------------------------------------------------------------- 1 | j -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/output_45/k.txt: -------------------------------------------------------------------------------- 1 | k -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/output_45/l.txt: -------------------------------------------------------------------------------- 1 | l -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/output_45/m.txt: -------------------------------------------------------------------------------- 1 | m -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/output_45/n.txt: -------------------------------------------------------------------------------- 1 | n -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/output_45/o.txt: -------------------------------------------------------------------------------- 1 | o -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/output_45/p.txt: -------------------------------------------------------------------------------- 1 | p -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/output_45/q.txt: -------------------------------------------------------------------------------- 1 | q -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/output_45/r.txt: -------------------------------------------------------------------------------- 1 | r -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/output_45/s.txt: -------------------------------------------------------------------------------- 1 | s -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/output_45/t.txt: -------------------------------------------------------------------------------- 1 | t -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/output_45/u.txt: -------------------------------------------------------------------------------- 1 | u -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/output_45/v.txt: -------------------------------------------------------------------------------- 1 | v -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/output_45/w.txt: -------------------------------------------------------------------------------- 1 | w -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/output_45/x.txt: -------------------------------------------------------------------------------- 1 | x -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/output_45/y.txt: -------------------------------------------------------------------------------- 1 | y -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/output_45/z.txt: -------------------------------------------------------------------------------- 1 | z -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/92_files/file1.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/92_files/file2.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/92_files/file3.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/92_files/file4.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/92_files/file5.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /17.Python for Automation/01.Automate File Folder Terminal/hello_world.py: -------------------------------------------------------------------------------- 1 | print("hello world") 2 | -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/01_Basic_WebScraping/ietf_scraper/ietf_scraper/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/10.File IO/test.txt: -------------------------------------------------------------------------------- 1 | ha ha ha.. this is funny joke. -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/03_Advanced_Techniques/news_scraper/news_scraper/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Python DB-API/Python - PostgreSQL/catalog/README.txt: -------------------------------------------------------------------------------- 1 | Place your catalog project in this directory. 2 | -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/93_files/subdirs/level11/1.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/93_files/subdirs/level11/2.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/93_files/subdirs/level11/4.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/93_files/subdirs/level12/6.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/users.txt: -------------------------------------------------------------------------------- 1 | richard 2 | vivian -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/02_Learning_to_Crawl/article_crawler/article_crawler/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/31.01.CSV File/files/cats.csv: -------------------------------------------------------------------------------- 1 | Name,Breed,Age 2 | Conny,Burmese Shorthair,5 3 | -------------------------------------------------------------------------------- /05.More Python - Microsoft/test.txt: -------------------------------------------------------------------------------- 1 | This is the first line 2 | This is the second line 3 | This is the third line -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/93_files/subdirs/level12/level121/3.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/93_files/subdirs/level12/level121/5.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/93_files/subdirs/level12/level121/6.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/97_file/97_file.txt: -------------------------------------------------------------------------------- 1 | i like python 2 | -------------------------------------------------------------------------------- /05.More Python - Microsoft/08.using_with.py: -------------------------------------------------------------------------------- 1 | with open('output2.txt','wt') as file: 2 | file.write('Hello again !') -------------------------------------------------------------------------------- /11.Learning Python - JM/01.Basic/helloworld.py: -------------------------------------------------------------------------------- 1 | # 2 | # Example file for HelloWorld 3 | # 4 | print("Hello World") 5 | -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/03_Advanced_Techniques/news_scraper_challenge/news_scraper_challenge/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/96_file/96_file.txt: -------------------------------------------------------------------------------- 1 | I 2 | just love 3 | python 4 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/12.Testing/test_manual_run.txt: -------------------------------------------------------------------------------- 1 | python -m unittest 2 | 3 | python -m unittest -v -------------------------------------------------------------------------------- /01.Complete Python Bootcamp - JP/MyMainPackage/SubPackage/mysubscript.py: -------------------------------------------------------------------------------- 1 | def sub_report(): 2 | print("Hey I'm a function inside mysubscript.") -------------------------------------------------------------------------------- /01.Complete Python Bootcamp - JP/MyMainPackage/some_main_script.py: -------------------------------------------------------------------------------- 1 | def report_main(): 2 | print("Hey I'm a some main function in main package") -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/15.Web Development with Python/static/style.css: -------------------------------------------------------------------------------- 1 | body{ 2 | background-color: aqua; 3 | } -------------------------------------------------------------------------------- /13.Learning Python Libraries/01.Learning Python Standard Library - KH/03.Python Input Output/data/scores.txt: -------------------------------------------------------------------------------- 1 | GBJ : 100 2 | KHD : 99 3 | BBB : 89 -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/10.Looping/emoji_art.py: -------------------------------------------------------------------------------- 1 | count = 1 2 | 3 | while count <= 10: 4 | print("\U0001f600" * count) 5 | count += 1 -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/31.02.Pickling/frozencat.json: -------------------------------------------------------------------------------- 1 | {"age": "5", "breed": "buremse shorthair", "name": "conney", "py/object": "__main__.Cat"} -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/37_words2.txt: -------------------------------------------------------------------------------- 1 | A tree is a woody perennial plant,typically with branches. 2 | -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 51-75/output/output_73.csv: -------------------------------------------------------------------------------- 1 | x,y 2 | 6,10 3 | 8,18 4 | 12,20 5 | 14,22 6 | 16,24 7 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/15.Web Development with Python/database.csv: -------------------------------------------------------------------------------- 1 | a@test.com,hello,test1 2 | test2@hotmail.com,test2,hello2 3 | -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/36_words1.txt: -------------------------------------------------------------------------------- 1 | A tree is a woody perennial plant, typically with branches. 2 | -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/output_44.txt: -------------------------------------------------------------------------------- 1 | abc 2 | def 3 | ghi 4 | jkl 5 | mno 6 | pqr 7 | stu 8 | vwx 9 | -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/DOM1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/DOM1.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/DOM2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/DOM2.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/DOM3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/DOM3.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/DOM4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/DOM4.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/DOM5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/DOM5.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/DTD1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/DTD1.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/DTD2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/DTD2.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/DTD3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/DTD3.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/DTD4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/DTD4.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/DTD5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/DTD5.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/DTD6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/DTD6.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/DTD7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/DTD7.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/DTD8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/DTD8.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/DTD9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/DTD9.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/XML1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/XML1.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/XML10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/XML10.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/XML11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/XML11.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/XML12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/XML12.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/XML13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/XML13.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/XML14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/XML14.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/XML15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/XML15.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/XML16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/XML16.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/XML2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/XML2.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/XML3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/XML3.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/XML4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/XML4.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/XML5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/XML5.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/XML6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/XML6.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/XML7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/XML7.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/XML8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/XML8.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/XML9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/XML9.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/XSLT1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/XSLT1.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/XSLT2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/XSLT2.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/XSLT3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/XSLT3.png -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/10.File IO/translated_one.txt: -------------------------------------------------------------------------------- 1 | 私の名前はPhone Thiri Yadanaです。 2 | 私は本を読んだり映画を見たりするのが好きです:) 3 | コーディングも大好きです。 4 | -------------------------------------------------------------------------------- /10.Python Code Challenges/Level_02/rooster2.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/10.Python Code Challenges/Level_02/rooster2.wav -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/XMLtypes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/XMLtypes.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/X_Path.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/X_Path.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/X_Path0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/X_Path0.png -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/30.File IO/story_reader.py: -------------------------------------------------------------------------------- 1 | #read 2 | with open ('story.txt') as file: 3 | data = file.read() 4 | print(data) 5 | file.closed -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/95_file/95_file.txt: -------------------------------------------------------------------------------- 1 | an 2 | apple 3 | a 4 | day 5 | keep 6 | the 7 | doctor 8 | away 9 | -------------------------------------------------------------------------------- /13.Learning Python Libraries/01.Learning Python Standard Library - KH/03.Python Input Output/data/test.txt: -------------------------------------------------------------------------------- 1 | Today is a wonderful day. 2 | The weather is getting cold. -------------------------------------------------------------------------------- /01.Complete Python Bootcamp - JP/Cap.py: -------------------------------------------------------------------------------- 1 | def cap_text(text): 2 | ''' 3 | input a string 4 | output the first character capitalized string 5 | ''' 6 | return text.title() -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/15.Web Development with Python/database.txt: -------------------------------------------------------------------------------- 1 | email,subject,message 2 | test3@hotmail.com,hello,as 3 | test@hotmail.com,hh,j -------------------------------------------------------------------------------- /10.Python Code Challenges/Level_02/test/test_dict.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/10.Python Code Challenges/Level_02/test/test_dict.txt -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/02.Python Basics II/cleancode.py: -------------------------------------------------------------------------------- 1 | def is_even(num): 2 | return num%2 == 0 3 | 4 | print(is_even(50)) 5 | print(is_even(11)) -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/10.File IO/source.txt: -------------------------------------------------------------------------------- 1 | My name is Phone Thiri Yadana. 2 | I like reading books and watching movie :) 3 | and I also love coding. -------------------------------------------------------------------------------- /10.Python Code Challenges/Level_02/test/test_dict.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/10.Python Code Challenges/Level_02/test/test_dict.pickle -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/XML_namespace1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/XML_namespace1.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/XML_namespace2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/XML_namespace2.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/XML_namespace3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/XML_namespace3.png -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/img/X_Path_Example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/img/X_Path_Example.png -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/07.Variables and Strings/none.py: -------------------------------------------------------------------------------- 1 | name = 'Mary' 2 | age = 25 3 | child = None 4 | 5 | print(f'{name} is {age} years old. She has {child} of child.') -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/10.Looping/repeater.py: -------------------------------------------------------------------------------- 1 | count = int(input("How many times do I have to tell you? ")) 2 | 3 | for c in range(count): 4 | print("Clean up you room!") -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/31.02.Pickling/pets.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/02.Modern Python 3 Bootcamp - CS/31.02.Pickling/pets.pickle -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/35.Python + SQL/dog_db.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/02.Modern Python 3 Bootcamp - CS/35.Python + SQL/dog_db.db -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/01.Python Basics/matrix.py: -------------------------------------------------------------------------------- 1 | my_matrix = [ 2 | [1,2,3], 3 | [4,5,6], 4 | [7,8,9], 5 | ] 6 | 7 | print(my_matrix[1][2]) -------------------------------------------------------------------------------- /11.Learning Python - JM/03.Working with Files/testzip.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/11.Learning Python - JM/03.Working with Files/testzip.zip -------------------------------------------------------------------------------- /11.Learning Python - JM/03.Working with Files/testarchive.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/11.Learning Python - JM/03.Working with Files/testarchive.zip -------------------------------------------------------------------------------- /14.Learning Python Generators - JMQ/02.Using Generator as Context Manager/03.Use the yield value/text_log: -------------------------------------------------------------------------------- 1 | this is pre-defined header 2 | This is body. 3 | this is pre-defined footer 4 | -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/32.Web Scraping/blog_data.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/02.Modern Python 3 Bootcamp - CS/32.Web Scraping/blog_data.csv -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/02.Python Basics II/range.py: -------------------------------------------------------------------------------- 1 | for number in range(0, 100, 10): 2 | print(number) 3 | 4 | for _ in range(2): 5 | print(list(range(10))) -------------------------------------------------------------------------------- /17.Python for Automation/00.data/AfterOrganized/AUDIO/Random.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/17.Python for Automation/00.data/AfterOrganized/AUDIO/Random.m4a -------------------------------------------------------------------------------- /01.Complete Python Bootcamp - JP/sweetfile.txt: -------------------------------------------------------------------------------- 1 | Hello this is kid. 2 | I am an awesome person. 3 | I can do anything I want which is pretty awesome too. 4 | Super cute tooSuper cute tooSuper cute too -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/output_43.txt: -------------------------------------------------------------------------------- 1 | ab 2 | cd 3 | ef 4 | gh 5 | ij 6 | kl 7 | mn 8 | op 9 | qr 10 | st 11 | uv 12 | wx 13 | yz 14 | -------------------------------------------------------------------------------- /17.Python for Automation/00.data/AfterOrganized/IMAGES/Random.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/17.Python for Automation/00.data/AfterOrganized/IMAGES/Random.jpeg -------------------------------------------------------------------------------- /17.Python for Automation/00.data/AfterOrganized/VIDEOS/Random.mov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/17.Python for Automation/00.data/AfterOrganized/VIDEOS/Random.mov -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/08.Modules In Python/shopping/shopping_cart.py: -------------------------------------------------------------------------------- 1 | print(__name__) 2 | 3 | def buy(item): 4 | cart = [] 5 | cart.append(item) 6 | return cart -------------------------------------------------------------------------------- /07.Data Structures & Algorithms/Big O/O(log_n).py: -------------------------------------------------------------------------------- 1 | # Binary search is O(log n) in the worst case because 2 | # each time you eliminate options, you eliminate half of them (assumption: base 2) 3 | 4 | -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/07_xslt_examples/photos/candles.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/07_xslt_examples/photos/candles.jpg -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/07_xslt_examples/photos/teacup.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/07_xslt_examples/photos/teacup.jpg -------------------------------------------------------------------------------- /19.XML and JSON/02.API Documentation with JSON and XML/img/XML1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/02.API Documentation with JSON and XML/img/XML1.png -------------------------------------------------------------------------------- /19.XML and JSON/02.API Documentation with JSON and XML/img/XML2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/02.API Documentation with JSON and XML/img/XML2.png -------------------------------------------------------------------------------- /19.XML and JSON/02.API Documentation with JSON and XML/img/XML3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/02.API Documentation with JSON and XML/img/XML3.png -------------------------------------------------------------------------------- /19.XML and JSON/02.API Documentation with JSON and XML/img/XML4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/02.API Documentation with JSON and XML/img/XML4.png -------------------------------------------------------------------------------- /19.XML and JSON/02.API Documentation with JSON and XML/img/XML5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/02.API Documentation with JSON and XML/img/XML5.png -------------------------------------------------------------------------------- /19.XML and JSON/02.API Documentation with JSON and XML/img/XML6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/02.API Documentation with JSON and XML/img/XML6.png -------------------------------------------------------------------------------- /19.XML and JSON/02.API Documentation with JSON and XML/img/XML7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/02.API Documentation with JSON and XML/img/XML7.png -------------------------------------------------------------------------------- /19.XML and JSON/02.API Documentation with JSON and XML/img/schema.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/02.API Documentation with JSON and XML/img/schema.png -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/35.Python + SQL/friends/my_friends.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/02.Modern Python 3 Bootcamp - CS/35.Python + SQL/friends/my_friends.db -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 51-75/output/output_74.csv: -------------------------------------------------------------------------------- 1 | x,y 2 | 3,5 3 | 4,9 4 | 6,10 5 | 7,11 6 | 8,12 7 | 6,10 8 | 8,18 9 | 12,20 10 | 14,22 11 | 16,24 12 | -------------------------------------------------------------------------------- /07.Data Structures & Algorithms/Big O/O(1)_Constant_Time.py: -------------------------------------------------------------------------------- 1 | # Many simple checks and assignments are Big O(1) 2 | 3 | my_favourite_desserts = {"cake": 1, "cookies": 2} 4 | print(my_favourite_desserts["cake"]) -------------------------------------------------------------------------------- /01.Complete Python Bootcamp - JP/myprogram.py: -------------------------------------------------------------------------------- 1 | from MyMainPackage import some_main_script 2 | from MyMainPackage.SubPackage import mysubscript 3 | 4 | some_main_script.report_main() 5 | mysubscript.sub_report() -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/94_file/94_urls.txt: -------------------------------------------------------------------------------- 1 | https:/www.google.com 2 | https:/www.yahoo.com 3 | https:/www.stackoverflow.com 4 | https:/www.pythonhow.com 5 | -------------------------------------------------------------------------------- /15.Python Decorators - JM/05.Decorators in Real World/flask_fib.py: -------------------------------------------------------------------------------- 1 | from flask import Flask 2 | 3 | app = Flask(__name__) 4 | 5 | 6 | @app.route("/") 7 | def print_fib(): 8 | return "

Fibonacci

" 9 | -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/03_working_with_XML/FirstXMLFile.css: -------------------------------------------------------------------------------- 1 | FirstTag { 2 | display: block; 3 | font-size: large; 4 | font-family: Arial, Helvetica, sans-serif; 5 | color: blueviolet; 6 | } 7 | -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/07_xslt_examples/photos/teapot_bone.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/07_xslt_examples/photos/teapot_bone.jpg -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/07_xslt_examples/photos/teapot_white.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/07_xslt_examples/photos/teapot_white.jpg -------------------------------------------------------------------------------- /19.XML and JSON/02.API Documentation with JSON and XML/img/namespace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/02.API Documentation with JSON and XML/img/namespace.png -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/94_file/corrected_urls.txt: -------------------------------------------------------------------------------- 1 | http://www.google.com 2 | http://www.yahoo.com 3 | http://www.stackoverflow.com 4 | http://www.pythonhow.com 5 | -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/07_xslt_examples/photos/javaco_tea_logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/07_xslt_examples/photos/javaco_tea_logo.gif -------------------------------------------------------------------------------- /17.Python for Automation/01.Automate File Folder Terminal/02.terminal_command.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | 3 | for i in range(5): 4 | # call another script 5 | subprocess.check_call(['python', 'hello_world.py']) 6 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/08.Modules In Python/module_utilities.py: -------------------------------------------------------------------------------- 1 | print(__name__) 2 | 3 | def multiply(num1, num2): 4 | return num1 * num2 5 | 6 | def divide(num1, num2): 7 | return num1/num2 -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/Email Project/mail.properties: -------------------------------------------------------------------------------- 1 | [EmailSection] 2 | host.address=smtp.gmail.com 3 | port.number=587 4 | email.username=username 5 | email.password=password -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/Twilio Project/twilio.properties: -------------------------------------------------------------------------------- 1 | [TwilioSetup] 2 | account_sid=account_sid 3 | auth_token=auth_token 4 | from_number=from_number 5 | to_number=to_number -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/04_manipulating_xml_with_DOM/javaco_tea_logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/19.XML and JSON/01.XML Essential/04_manipulating_xml_with_DOM/javaco_tea_logo.gif -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/10.Looping/kid.py: -------------------------------------------------------------------------------- 1 | message = input("Hey how's it going? ") 2 | 3 | while message != "stop copying me": 4 | print(message + "\n") 5 | message = input() 6 | 7 | print("hehe.. come on smile :P") -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/10.File IO/file_test.py: -------------------------------------------------------------------------------- 1 | with open('test.txt', mode='r+') as my_file: 2 | 3 | print(my_file.readlines()) 4 | text = my_file.write("ha ha ha.. this is funny joke.") 5 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/14.Web Scraping/hacker_news.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/14.Web Scraping/hacker_news.html -------------------------------------------------------------------------------- /16.Functional Programming with Python - SW/01.First Class Functions/basic.py: -------------------------------------------------------------------------------- 1 | def say_hello(name): 2 | print(f"Hello {name}") 3 | 4 | 5 | if __name__ == "__main__": 6 | say_hello2 = say_hello 7 | say_hello2("John") 8 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/02.Python Basics II/12. Exercise Tricky Counter.py: -------------------------------------------------------------------------------- 1 | my_list = [1,2,3,4,5,6,7,8,9,10] 2 | 3 | sum = 0 4 | 5 | for item in my_list: 6 | sum += item 7 | 8 | print(f'Sum : {sum}') 9 | -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/formula.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/formula.jpg -------------------------------------------------------------------------------- /06.Core Python - Getting Started/wasteland.txt: -------------------------------------------------------------------------------- 1 | What are the roots that clutch, what branches grow 2 | out of this stony rubbishson of man, 3 | you cannot say, or guess, for you know only, 4 | A heap of broken images, where the sun beats 5 | -------------------------------------------------------------------------------- /12.Python Object Oriented Programming - JM/02.Inheritance and Composition/composition.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/12.Python Object Oriented Programming - JM/02.Inheritance and Composition/composition.png -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/30.File IO/newstory.txt: -------------------------------------------------------------------------------- 1 | "NEW STORY OF MY LIFE" 2 | Life is short, but amazing. 3 | Never forget to enjoy and live the most out of it. 4 | 5 | This is part 2 of my story. 6 | Live in the moment of every seconds :). -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/01.Python Basics/28.1 Exercise Repl.py: -------------------------------------------------------------------------------- 1 | # using this list: 2 | basket = ["Banana", ["Apples", ["Oranges"], "Blueberries"]]; 3 | # access "Oranges" and print it: 4 | 5 | print(basket[1][1][0]) 6 | -------------------------------------------------------------------------------- /13.Learning Python Libraries/01.Learning Python Standard Library - KH/03.Python Input Output/02_input_output.py: -------------------------------------------------------------------------------- 1 | # Output 2 | print("hello") 3 | 4 | # Input 5 | color = input("what's your favourite color? ") 6 | print(f"oh.. I like {color} too.") -------------------------------------------------------------------------------- /19.XML and JSON/02.API Documentation with JSON and XML/02_JSON/weather_oneday.json: -------------------------------------------------------------------------------- 1 | { 2 | "date": "2015-09-01", 3 | "description": "sunny", 4 | "maxTemp": 22, 5 | "minTemp": 20, 6 | "windSpeed": 12, 7 | "danger": false 8 | } -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/31.01.CSV File/fighters.csv: -------------------------------------------------------------------------------- 1 | Name,Country,Height (in cm) 2 | Ryu,Japan,175 3 | Ken,USA,175 4 | Chun-Li,China,165 5 | Guile,USA,182 6 | E. Honda,Japan,185 7 | Dhalsim,India,176 8 | Blanka,Brazil,192 9 | Zangief,Russia,214 -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/Email Project/email_content.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Hello $name.. what a beautiful day :) 7 | 8 | -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/29_spherprt.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/29_spherprt.gif -------------------------------------------------------------------------------- /14.Learning Python Generators - JMQ/01.Generator Functions and Expressions/02.Generator Expression/02.even_integers_generator_expression.py: -------------------------------------------------------------------------------- 1 | even_integers = (num for num in range(10) if num%2 ==0) 2 | print(even_integers) 3 | print(list(even_integers)) -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/13.Lists Comprehensions/nested_list.py: -------------------------------------------------------------------------------- 1 | board = [[num for num in range(1,4)] for val in range(1,4)] 2 | print(board) 3 | 4 | results = [["X" if num%2 == 0 else "O" for num in range(3)] for i in range(3)] 5 | print(results) -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/02.Python Basics II/truth_falsey.py: -------------------------------------------------------------------------------- 1 | username = "john" 2 | password = "123" 3 | 4 | # if username and password both exists 5 | if username and password: 6 | print("you have both username and password") -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/04.Advanced Python Functional Programming/filter.py: -------------------------------------------------------------------------------- 1 | #filter 2 | def only_odd(item): 3 | return item % 2 != 0 4 | 5 | my_list = [1,2,3] 6 | print(my_list) 7 | print(list(filter(only_odd, my_list))) 8 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/04.Advanced Python Functional Programming/map.py: -------------------------------------------------------------------------------- 1 | #map 2 | def multiply_by_two(item): 3 | return item*2 4 | 5 | my_list = [1,2,3] 6 | print(my_list) 7 | print(list(map(multiply_by_two, my_list))) 8 | -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/31.01.CSV File/fighters_with_pipe.csv: -------------------------------------------------------------------------------- 1 | Name|Country|Height (in cm) 2 | Ryu|Japan|175 3 | Ken|USA|175 4 | Chun-Li|China|165 5 | Guile|USA|182 6 | E. Honda|Japan|185 7 | Dhalsim|India|176 8 | Blanka|Brazil|192 9 | Zangief|Russia|214 -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/database/database.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/database/database.db -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/database/database1.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/database/database1.db -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/04.Advanced Python Functional Programming/map_practice.py: -------------------------------------------------------------------------------- 1 | items = ["list", "of", "words"] 2 | 3 | def count_letters(x): 4 | return len(x) 5 | 6 | new_items = list(map(count_letters, items)) 7 | print(new_items) -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/Twitter Bot Project/twitter.properties: -------------------------------------------------------------------------------- 1 | [AppSetting] 2 | consumer.API.key=apikey 3 | consumer.API.secret.key=apisecretkey 4 | access.token=accesstoken 5 | access.token.secrect=accesstokensecret -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/15.Web Development with Python/requirements.txt: -------------------------------------------------------------------------------- 1 | certifi==2020.4.5.1 2 | click==7.1.1 3 | Flask==1.1.2 4 | itsdangerous==1.1.0 5 | Jinja2==2.11.1 6 | MarkupSafe==1.1.1 7 | Werkzeug==1.0.1 8 | wincertstore==0.2 9 | -------------------------------------------------------------------------------- /07.Data Structures & Algorithms/Big O/O(n)_Linear_Time.py: -------------------------------------------------------------------------------- 1 | # Simple for loops are almost always O(n) 2 | # such for list, tuples 3 | 4 | my_favourite_desserts = ["chocolate", "ice cream", "cracker"] 5 | 6 | for item in my_favourite_desserts: 7 | print(item) 8 | -------------------------------------------------------------------------------- /16.Functional Programming with Python - SW/01.First Class Functions/returning_functions_basic.py: -------------------------------------------------------------------------------- 1 | def create_printer(): 2 | def printer(): 3 | print("Hello functional!") 4 | return printer 5 | 6 | 7 | my_printer = create_printer() 8 | my_printer() 9 | -------------------------------------------------------------------------------- /16.Functional Programming with Python - SW/03.Advanced Functional Concepts/recursion_count_down.py: -------------------------------------------------------------------------------- 1 | def count_down(x): 2 | if x == 0: 3 | print("Done!") 4 | return 5 | print(x) 6 | count_down(x-1) 7 | 8 | 9 | count_down(10) 10 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/01.Python Basics/list_unpacking.py: -------------------------------------------------------------------------------- 1 | a,b,c = ["A","B","C"] 2 | print(a) 3 | print(b) 4 | print(c) 5 | 6 | a,b,c,*other,d = [1,2,3,4,5,6,7,8,9] 7 | print(a) 8 | print(b) 9 | print(c) 10 | print(other) 11 | print(d) -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/output_41.txt: -------------------------------------------------------------------------------- 1 | a 2 | b 3 | c 4 | d 5 | e 6 | f 7 | g 8 | h 9 | i 10 | j 11 | k 12 | l 13 | m 14 | n 15 | o 16 | p 17 | q 18 | r 19 | s 20 | t 21 | u 22 | v 23 | w 24 | x 25 | y 26 | z 27 | -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/03_Advanced_Techniques/form/form/spiders/__init__.py: -------------------------------------------------------------------------------- 1 | # This package will contain the spiders of your Scrapy project 2 | # 3 | # Please refer to the documentation for information on how to create and manage 4 | # your spiders. 5 | -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/04_Acting_Human/locations/locations/spiders/__init__.py: -------------------------------------------------------------------------------- 1 | # This package will contain the spiders of your Scrapy project 2 | # 3 | # Please refer to the documentation for information on how to create and manage 4 | # your spiders. 5 | -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/04_Acting_Human/profiles/profiles/spiders/__init__.py: -------------------------------------------------------------------------------- 1 | # This package will contain the spiders of your Scrapy project 2 | # 3 | # Please refer to the documentation for information on how to create and manage 4 | # your spiders. 5 | -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/31.01.CSV File/capatalized_fighters.csv: -------------------------------------------------------------------------------- 1 | NAME,COUNTRY,HEIGHT (IN CM) 2 | RYU,JAPAN,175 3 | KEN,USA,175 4 | CHUN-LI,CHINA,165 5 | GUILE,USA,182 6 | E. HONDA,JAPAN,185 7 | DHALSIM,INDIA,176 8 | BLANKA,BRAZIL,192 9 | ZANGIEF,RUSSIA,214 10 | -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/31.01.CSV File/csv_dict_reader.py: -------------------------------------------------------------------------------- 1 | from csv import DictReader 2 | 3 | with open('fighters.csv') as file: 4 | csv_dict_reader = DictReader(file) 5 | 6 | for row in csv_dict_reader: 7 | print(row) 8 | print(row['Name']) -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/PDFs Processing/pdfs/wtr.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/PDFs Processing/pdfs/wtr.pdf -------------------------------------------------------------------------------- /13.Learning Python Libraries/01.Learning Python Standard Library - KH/03.Python Input Output/data/data.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/13.Learning Python Libraries/01.Learning Python Standard Library - KH/03.Python Input Output/data/data.zip -------------------------------------------------------------------------------- /16.Functional Programming with Python - SW/03.Advanced Functional Concepts/partial_and_currying_with_functools.py: -------------------------------------------------------------------------------- 1 | from functools import partial 2 | 3 | 4 | def add(x, y, z): 5 | return x + y + z 6 | 7 | 8 | add_5 = partial(add, 5) 9 | print(add_5(6, 7)) 10 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/06.Advanced Python Error Handling/error_handling2.py: -------------------------------------------------------------------------------- 1 | def sum(num1, num2): 2 | try: 3 | return num1+num2 4 | except (TypeError,ZeroDivisionError) as err: 5 | print(f'opps !!! {err}') 6 | 7 | print(sum(1,'2')) -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/Image Processing/astro/astro.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/Image Processing/astro/astro.jpg -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/PDFs Processing/pdfs/dummy.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/PDFs Processing/pdfs/dummy.pdf -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/PDFs Processing/pdfs/twopage.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/PDFs Processing/pdfs/twopage.pdf -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/15.Web Development with Python/static/assets/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/15.Web Development with Python/static/assets/favicon.ico -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/17.Machine Learning and Data Science/iris_flowers.joblib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/17.Machine Learning and Data Science/iris_flowers.joblib -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 51-75/json file added employees_58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 51-75/json file added employees_58.png -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/01_Basic_WebScraping/ietf_scraper/ietf_scraper/spiders/__init__.py: -------------------------------------------------------------------------------- 1 | # This package will contain the spiders of your Scrapy project 2 | # 3 | # Please refer to the documentation for information on how to create and manage 4 | # your spiders. 5 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/08.Modules In Python/builtin_modules_2.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | first = sys.argv[1] 4 | second = sys.argv[2] 5 | print(f'hello {first} , {second}') 6 | 7 | #testing 8 | #run from terminal 9 | #python builtin_modules_2.py richard drahcir -------------------------------------------------------------------------------- /07.Data Structures & Algorithms/Big O/O(n2).py: -------------------------------------------------------------------------------- 1 | # Two nested loops are O(n^2) 2 | 3 | my_favourite_desserts = ["chocolate", "ice cream", "crackers"] 4 | quantities = [10, 20, 30] 5 | 6 | for item in my_favourite_desserts: 7 | for q in quantities: 8 | print(item, " - ", q) -------------------------------------------------------------------------------- /16.Functional Programming with Python - SW/03.Advanced Functional Concepts/recursion_count_up.py: -------------------------------------------------------------------------------- 1 | def count_up(x, maximum): 2 | if x > maximum: 3 | print("Done!") 4 | return 5 | print(x) 6 | count_up(x+1, maximum) 7 | 8 | 9 | count_up(1, 10) 10 | -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/03_Advanced_Techniques/news_scraper/news_scraper/spiders/__init__.py: -------------------------------------------------------------------------------- 1 | # This package will contain the spiders of your Scrapy project 2 | # 3 | # Please refer to the documentation for information on how to create and manage 4 | # your spiders. 5 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/09.Debugging In Python/debugging_test.py: -------------------------------------------------------------------------------- 1 | import pdb 2 | 3 | def add(num1, num2): 4 | pdb.set_trace() 5 | t = 4*5 6 | return num1 + num2 7 | 8 | print(add(1,'asdkf')) 9 | 10 | #testing 11 | #next , step, a for arguments -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/Image Processing/pokedex/pikachu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/Image Processing/pokedex/pikachu.jpg -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/Image Processing/pokedex/squirtle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/Image Processing/pokedex/squirtle.jpg -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/15.Web Development with Python/static/assets/images/profil.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/15.Web Development with Python/static/assets/images/profil.jpg -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/15.Web Development with Python/static/assets/images/space.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/15.Web Development with Python/static/assets/images/space.jpg -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/database/31.originalDB/database1.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/database/31.originalDB/database1.db -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/02_Learning_to_Crawl/article_crawler/article_crawler/spiders/__init__.py: -------------------------------------------------------------------------------- 1 | # This package will contain the spiders of your Scrapy project 2 | # 3 | # Please refer to the documentation for information on how to create and manage 4 | # your spiders. 5 | -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/03_working_with_XML/FirstXMLFile.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | This is our first XML file. 5 | 6 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/02.Python Basics II/enumerate.py: -------------------------------------------------------------------------------- 1 | for item in enumerate("helloooooo"): 2 | print(item) 3 | 4 | 5 | for i,char in enumerate(["A","B","C"]): 6 | print(i, char) 7 | 8 | for i,item in enumerate(list(range(100,110))): 9 | print(i, item) -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/Image Processing/pokedex/bulbasaur.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/Image Processing/pokedex/bulbasaur.jpg -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/Image Processing/pokedex/charmander.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/Image Processing/pokedex/charmander.jpg -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/PDFs Processing/pdfs/processed/tilt.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/PDFs Processing/pdfs/processed/tilt.pdf -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 51-75/exercise_60.py: -------------------------------------------------------------------------------- 1 | # create a program that prints Hello repeately. 2 | 3 | def hello(times): 4 | for i in range(times): 5 | print('Hello') 6 | 7 | hello(5) 8 | 9 | while True: 10 | print('Hello') -------------------------------------------------------------------------------- /06.Core Python - Getting Started/banner.py: -------------------------------------------------------------------------------- 1 | def banner(message, border='-'): 2 | line = border * len(message) 3 | print(line) 4 | print(message) 5 | print(line) 6 | 7 | banner('Moon and Stars') 8 | banner('Moon and Stars', '*') 9 | banner(border='.', message = 'Sun Moon and Stars') -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/03.Advanced Python Object Oriented Programming/23. MRO - Method Resolution Order.py: -------------------------------------------------------------------------------- 1 | class A: 2 | num = 10 3 | 4 | class B(A): 5 | pass 6 | 7 | class C(A): 8 | num =1 9 | 10 | class D(B,C): 11 | pass 12 | 13 | print(D.mro()) -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/04.Advanced Python Functional Programming/13.1 Exercise Repl.py: -------------------------------------------------------------------------------- 1 | #finding duplicates 2 | some_list = ['a', 'b', 'c', 'b', 'd', 'm', 'n', 'n'] 3 | 4 | duplicates = list(set([x for x in some_list if some_list.count(x) > 1])) 5 | 6 | print(duplicates) -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/PDFs Processing/pdfs/processed/merged.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/PDFs Processing/pdfs/processed/merged.pdf -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/PDFs Processing/pdfs/processed/super.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/PDFs Processing/pdfs/processed/super.pdf -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/15.Web Development with Python/static/assets/apple-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/15.Web Development with Python/static/assets/apple-icon-180x180.png -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/15.Web Development with Python/static/assets/images/work001-01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/15.Web Development with Python/static/assets/images/work001-01.jpg -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/15.Web Development with Python/static/assets/images/work001-02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/15.Web Development with Python/static/assets/images/work001-02.jpg -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/15.Web Development with Python/static/assets/images/work001-03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/15.Web Development with Python/static/assets/images/work001-03.jpg -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/15.Web Development with Python/static/assets/images/work001-04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/15.Web Development with Python/static/assets/images/work001-04.jpg -------------------------------------------------------------------------------- /05.More Python - Microsoft/02.basic_class.py: -------------------------------------------------------------------------------- 1 | class Presenter(): 2 | def __init__(self, name): 3 | self.name = name 4 | 5 | def say_hello(self): 6 | print(self.name) 7 | 8 | presenter = Presenter('Chris') 9 | presenter.name = 'Christopher' 10 | presenter.say_hello() -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/07_xslt_examples/01_01_simpletransform.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Try our new Herbal Tea! 8 | 9 | -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/07.Variables and Strings/km_to_miles_converter_project.py: -------------------------------------------------------------------------------- 1 | """km to miles converter""" 2 | print('**** Welcome to km to miles converter ****') 3 | km = int(input("How many km did you run today?")) 4 | miles = round(km * 0.621371,2) 5 | print(f'You have run {miles} miles.') -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/04.Advanced Python Functional Programming/filter_practice.py: -------------------------------------------------------------------------------- 1 | items = [12, 1, 7, 5, 4, 2, 9] 2 | 3 | def less_than_five(x): 4 | return x < 5 5 | 6 | #need to convert to list 7 | new_items = list(filter(less_than_five, items)) 8 | 9 | print(new_items) -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/04.Advanced Python Functional Programming/zip.py: -------------------------------------------------------------------------------- 1 | #zip 2 | my_list = [1,2,3] 3 | your_list = [100,200,300] 4 | their_list = [1000,2000,3000] 5 | 6 | print(list(zip(my_list, your_list, their_list))[0][2]) 7 | print(list(zip(my_list, your_list, their_list))) -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/15.Web Development with Python/static/assets/images/work01-hover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/15.Web Development with Python/static/assets/images/work01-hover.jpg -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/15.Web Development with Python/static/assets/images/work02-hover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/15.Web Development with Python/static/assets/images/work02-hover.jpg -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/15.Web Development with Python/static/assets/images/work03-hover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/15.Web Development with Python/static/assets/images/work03-hover.jpg -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/17.Machine Learning and Data Science/ML_SmartyBrain_Project/house.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/17.Machine Learning and Data Science/ML_SmartyBrain_Project/house.jpg -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/03_Advanced_Techniques/news_scraper_challenge/news_scraper_challenge/spiders/__init__.py: -------------------------------------------------------------------------------- 1 | # This package will contain the spiders of your Scrapy project 2 | # 3 | # Please refer to the documentation for information on how to create and manage 4 | # your spiders. 5 | -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/31.01.CSV File/heightconverted_fighters.csv: -------------------------------------------------------------------------------- 1 | Name,Country,Heights (in inches) 2 | Ken,USA,68.897675 3 | Chun-Li,China,64.960665 4 | Guile,USA,71.653582 5 | E. Honda,Japan,72.83468500000001 6 | Dhalsim,India,69.291376 7 | Blanka,Brazil,75.590592 8 | Zangief,Russia,84.252014 9 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/Image Processing/astro/processed/thumbnail.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/Image Processing/astro/processed/thumbnail.jpg -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/17.Machine Learning and Data Science/ML_SmartyBrain_Project/giraffe.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/17.Machine Learning and Data Science/ML_SmartyBrain_Project/giraffe.jpg -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/17.Machine Learning and Data Science/ML_SmartyBrain_Project/godzilla.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/17.Machine Learning and Data Science/ML_SmartyBrain_Project/godzilla.jpg -------------------------------------------------------------------------------- /14.Learning Python Generators - JMQ/01.Generator Functions and Expressions/01.Build Generator Function/even_integers_function.py: -------------------------------------------------------------------------------- 1 | # function solution 2 | def even_integers_function(n): 3 | result = [] 4 | for i in range(n): 5 | if i % 2 == 0: 6 | result.append(i) 7 | return result -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/Image Processing/pokedex/processed/small_squ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/Image Processing/pokedex/processed/small_squ.png -------------------------------------------------------------------------------- /10.Python Code Challenges/Level_01/create_largest_possible_number.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | def get_largest(lst): 4 | lst = np.array(lst) 5 | return lst.argsort()[-3:][::-1] 6 | 7 | 8 | if __name__ == "__main__": 9 | lst = [1,2,3,4,5,8,3,4] 10 | print(get_largest(lst)) -------------------------------------------------------------------------------- /11.Learning Python - JM/using_timeit.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | # Create a list of integers (0-50) using list comprehension 4 | nums_list_comp = [num for num in range(51)] 5 | print(nums_list_comp) 6 | 7 | # Create a list of integers (0-50) by unpacking range 8 | nums_unpack = [*range(51)] 9 | print(nums_unpack) -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/Image Processing/pokedex/processed/blurred_squ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/Image Processing/pokedex/processed/blurred_squ.png -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/Image Processing/pokedex/processed/crooked_squ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/Image Processing/pokedex/processed/crooked_squ.png -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/Image Processing/pokedex/processed/cropped_squ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/Image Processing/pokedex/processed/cropped_squ.png -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/Image Processing/pokedex/processed/greyscale_squ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/Image Processing/pokedex/processed/greyscale_squ.png -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/PDFs Processing/pdfs/processed/watermarked_super.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/PDFs Processing/pdfs/processed/watermarked_super.pdf -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/05_xpath/businesscard.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Vivian Fong 4 | (415) 555-4567 5 | (800) 555-9876 6 | (510) 555-1234 7 | vivian@test.com 8 | 9 | -------------------------------------------------------------------------------- /00.Python Mini Projects/03.Weight on different planets/planets.properties: -------------------------------------------------------------------------------- 1 | [WeightsSection] 2 | inspired by: https://www.exploratorium.edu/ronh/weight/ 3 | MERCURY=0.378 4 | VENUS=0.907 5 | MOON=0.166 6 | MARS=0.377 7 | JUPITER=2.528 8 | SATURN=1.064 9 | URANUS=0.889 10 | NEPTUNE=1.125 11 | PLUTO=0.067 12 | SUN=27.072 -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/31.01.CSV File/csv_reader_with_specific_delimiter.py: -------------------------------------------------------------------------------- 1 | from csv import DictReader 2 | 3 | #reading file with specific delimiter 4 | with open('fighters_with_pipe.csv') as file: 5 | csv_dict_reader = DictReader(file,delimiter='|') 6 | 7 | for row in csv_dict_reader: 8 | print(row) -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/08.Modules In Python/builtin_modules.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | # help(random) 4 | 5 | print(dir(random)) 6 | 7 | print(random.randint(1,10)) 8 | 9 | print(random.choice([1,2,3,4,5])) 10 | 11 | my_list = [1,2,3,4,5] 12 | random.shuffle(my_list) 13 | print(my_list) -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/01.Python Basics/13.1 Exercise Repl.py: -------------------------------------------------------------------------------- 1 | counter = 0 2 | 3 | counter += 1 4 | counter += 1 5 | counter += 1 6 | counter += 1 7 | counter -= 1 8 | counter *=2 9 | 10 | #Before you click RUN, guess what the counter variable holds in memory! 11 | print(counter) 12 | 13 | #6 -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/01.Python Basics/23. Exercise Type Conversion.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime 2 | 3 | birth_year = input("what year were you born?") 4 | current_year = datetime.now().year 5 | print(type(current_year)) 6 | 7 | age = current_year - int(birth_year) 8 | print(f"Your age is {age}") -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/08.Modules In Python/useful_modules2.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | from array import array 3 | 4 | print(datetime.date.today()) 5 | print(datetime.time(18,20,10)) 6 | 7 | #array 8 | #array performance is better than list 9 | my_arr = array('i',[1,2,3,4,5]) 10 | print(my_arr[2]) -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 01-25/exercise_15.py: -------------------------------------------------------------------------------- 1 | # Question: Create a dictionary that contains the keys a and b and their respective values 1 and 2 . 2 | 3 | #Answer 1 4 | my_dict = {'a':1, 'b':2} 5 | print(my_dict) 6 | 7 | #Answer 2 8 | d = dict(a=1,b=2) 9 | print(d) 10 | -------------------------------------------------------------------------------- /07.Data Structures & Algorithms/Foundation Algorithms - Lynda/03.Recursion/Fibonacci_sum_with_recursion.py: -------------------------------------------------------------------------------- 1 | def get_fibonacci_sum(n): 2 | if n == 0: return 0 3 | elif n == 1: return 1 4 | else: return get_fibonacci_sum(n-1)+get_fibonacci_sum(n-2) 5 | 6 | if __name__ == "__main__": 7 | print(get_fibonacci_sum(10)) -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/09_schema/businesscard.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Vivian Fong 4 | (415) 555-4567 5 | (800) 555-9876 6 | (510) 555-1234 7 | vivian@test.com 8 | 9 | -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/08.Boolean and Conditional Logic/is_vs_=.py: -------------------------------------------------------------------------------- 1 | a = [1,2,3] 2 | b = [1,2,3] 3 | c = b 4 | 5 | #contents of a and b are equal 6 | if a == b: 7 | print('a == b') 8 | 9 | 10 | #a and b are different instances 11 | if a is b: 12 | print('a is b') 13 | 14 | if c is b: 15 | print('c is b') -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/03.Advanced Python Object Oriented Programming/mro example.py: -------------------------------------------------------------------------------- 1 | # https://data-flair.training/blogs/python-multiple-inheritance/ 2 | 3 | class X:pass 4 | class Y: pass 5 | class Z:pass 6 | class A(X,Y):pass 7 | class B(Y,Z):pass 8 | class M(B,A,Z):pass 9 | 10 | print(M.mro()) -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 01-25/exercise_03.py: -------------------------------------------------------------------------------- 1 | # Question: Executing the code will throw an error. Can you explain why? 2 | 3 | a = 1 4 | b = 2 5 | print(a == b) 6 | print(b == c) 7 | 8 | 9 | # Answer: 10 | # will throw name 'c' is not defined because 'c' is never declared. 11 | -------------------------------------------------------------------------------- /07.Data Structures & Algorithms/Foundation Algorithms - Lynda/03.Recursion/list_length.py: -------------------------------------------------------------------------------- 1 | def get_list_length(my_list): 2 | if my_list == []: 3 | return 0 4 | else: 5 | return 1 + get_list_length(my_list[1:]) 6 | 7 | if __name__ == "__main__": 8 | lst = list(range(10)) 9 | print(get_list_length(lst)) -------------------------------------------------------------------------------- /14.Learning Python Generators - JMQ/02.Using Generator as Context Manager/01.Building Context Manager using yield/context_manager_framework.py: -------------------------------------------------------------------------------- 1 | # Basic Context Manager Framework 2 | 3 | @contextmanager 4 | def simple_context_manager(obj): 5 | try: 6 | # do something 7 | yield 8 | finally: 9 | # wrap up -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/08_document_type_definition_dtd/businesscard.dtd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 01-25/exercise_23.py: -------------------------------------------------------------------------------- 1 | # Question: Access the third value of key b from the dictionary. 2 | 3 | d = dict(a = list(range(1, 11)), b = list(range(11, 21)), c = list(range(21, 31))) 4 | 5 | # Expected output: 6 | # 13 7 | 8 | # Answer 9 | print(d['b'][2]) 10 | -------------------------------------------------------------------------------- /14.Learning Python Generators - JMQ/01.Generator Functions and Expressions/02.Generator Expression/03_convert_to_upper_generator_expression.py: -------------------------------------------------------------------------------- 1 | names_list = ["John", "Suzzie", "Kala", "Liz", "Rob", "Debby"] 2 | 3 | # conver names to uppercase 4 | uppercase_names = (name.upper() for name in names_list) 5 | 6 | print(list(uppercase_names)) -------------------------------------------------------------------------------- /13.Learning Python Libraries/03.Python Essential Libraries - JM/REST client extension test/test.http: -------------------------------------------------------------------------------- 1 | GET http://example.com HTTP/1.1 2 | 3 | ### 4 | 5 | GET https://httpbin.org/json HTTP/1.1 6 | 7 | ### 8 | 9 | POST https://httpbin.org/post HTTP/1.1 10 | x-my-name: phonethiri 11 | 12 | { 13 | "arg1": "this is something." 14 | } -------------------------------------------------------------------------------- /15.Python Decorators - JM/01.Functions/fibonacci.py: -------------------------------------------------------------------------------- 1 | def fibonacci(n): 2 | '''Return nth number of fibonacci sequence''' 3 | if n < 2: 4 | return n 5 | else: 6 | return fibonacci(n-1) + fibonacci(n-2) 7 | 8 | 9 | if __name__ == "__main__": 10 | for i in range(1, 10): 11 | print(fibonacci(i)) 12 | -------------------------------------------------------------------------------- /17.Python for Automation/00.data/fail_list.txt: -------------------------------------------------------------------------------- 1 | Dylan 19 F 2 | Julia 23 F 3 | Chad 17 F 4 | Jack 20 F 5 | Jalen 37 F 6 | Anthony 47 F 7 | Sydney 19 F 8 | Jenna 28 F 9 | Damean 42 F 10 | Zach 19 F 11 | Ben 14 F 12 | Albert 29 F 13 | Lauren 31 F 14 | Jordan 29 F 15 | Kaleb 47 F 16 | Bill 29 F 17 | Robin 24 F 18 | Jake 8 F 19 | Grace 18 F -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/Image Processing/image_astro.py: -------------------------------------------------------------------------------- 1 | from PIL import Image, ImageFilter 2 | 3 | img = Image.open('./astro/astro.jpg') 4 | print(img.size) 5 | 6 | #keep aspect ratio 7 | img.thumbnail((400,400)) 8 | img.save('./astro/processed/thumbnail.jpg') 9 | 10 | print(img.size) -------------------------------------------------------------------------------- /05.More Python - Microsoft/07.working_with_files_read.py: -------------------------------------------------------------------------------- 1 | stream = open('./test.txt',mode='rt') 2 | print('\nIs is readable: ' + str(stream.readable())) 3 | print('\nRead one char: ' + stream.read(1)) 4 | print('\nRead one line: ' + stream.readline()) 5 | print('\nRead all lines to the end of the file: \n' + str(stream.readlines())) 6 | stream.close() -------------------------------------------------------------------------------- /11.Learning Python - JM/04.Working with Web Data/samplexml.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Joe 4 | Marini 5 | Seattle 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /11.Learning Python - JM/range.py: -------------------------------------------------------------------------------- 1 | # Create a range object that goes from 0 to 5 2 | nums = range(6) 3 | print(type(nums)) 4 | 5 | # Convert nums to a list 6 | nums_list = list(nums) 7 | print(nums_list) 8 | 9 | # Create a new list of odd numbers from 1 to 11 by unpacking a range object 10 | nums_list2 = [*range(1,12,2)] 11 | print(nums_list2) -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/08.Boolean and Conditional Logic/truthiness.py: -------------------------------------------------------------------------------- 1 | """ 2 | Naturally Falsy include: empty objects, empty strings, None, zero 0 3 | """ 4 | print('What is your favourite book?') 5 | book = input() 6 | 7 | if book: 8 | print(f'Well.. {book} is my favourite book too.') 9 | else: 10 | print('I don\'t understand.') -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/13.Lists Comprehensions/list_comprehensions.py: -------------------------------------------------------------------------------- 1 | numbers = [1, 2, 3, 4, 5] 2 | doubled = [num*2 for num in numbers] 3 | print(doubled) 4 | 5 | 6 | name = "harry potter" 7 | all_cap = [letter.upper() for letter in name] 8 | print(all_cap) 9 | 10 | 11 | results = [bool(val) for val in [0, [], ""]] 12 | print(results) -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/35.Python + SQL/dog.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE dog( 2 | name TEXT, 3 | breed TEXT, 4 | age INT 5 | ); 6 | 7 | INSERT INTO dogs(name, breed, age) VALUES ('Blacky', 'Burmese Dog', 3); 8 | INSERT INTO dogs(name, breed, age) VALUES ('Brownie', 'Reteriver', 1); 9 | INSERT INTO dogs(name, breed, age) VALUES ('Champ', 'Husky', 2); -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/01.Python Basics/list_methods2.py: -------------------------------------------------------------------------------- 1 | basket = ["a","b","c","d","e"] 2 | 3 | #index 4 | print(basket.index("b")) 5 | 6 | #index search strat, end 7 | print(basket.index("d",0,4)) 8 | 9 | #python keywords 10 | print("x" in basket) 11 | print("b" in basket) 12 | 13 | #count 14 | print(basket.count("d")) -------------------------------------------------------------------------------- /14.Learning Python Generators - JMQ/03.Coroutines/01.Create a Corountine/coroutine_example.py: -------------------------------------------------------------------------------- 1 | def coroutine_example(): 2 | while True: 3 | x = yield 4 | # do something 5 | print(x) 6 | 7 | 8 | 9 | 10 | if __name__ == "__main__": 11 | c = coroutine_example() 12 | c.__next__() 13 | c.send(10) -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/02.Python Basics II/8. Exercise Logical Operators.py: -------------------------------------------------------------------------------- 1 | is_magician = False 2 | is_expert = False 3 | 4 | if is_magician and is_expert: 5 | print("You are a master magician !") 6 | elif is_magician and not is_expert: 7 | print("at least you are getting there.") 8 | else: 9 | print("you need magic powers.") -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/02.Python Basics II/docstring.py: -------------------------------------------------------------------------------- 1 | def hello(name): 2 | '''Info: accepts parameter and say hello to that name 3 | name: parameter''' 4 | print(f"hello {name}") 5 | 6 | 7 | #how to see docstring of a certain function 8 | #way 1 9 | print(help(hello)) 10 | 11 | #way 2 12 | print(hello.__doc__) -------------------------------------------------------------------------------- /14.Learning Python Generators - JMQ/01.Generator Functions and Expressions/05.Build Generator Pipeline/01.longest_name.py: -------------------------------------------------------------------------------- 1 | # use generators to find out the longest name 2 | 3 | full_names = (name.strip() for name in open("names.txt")) 4 | lengths = ((name, len(name)) for name in full_names) 5 | longest = max(lengths, key=lambda x: x[1]) 6 | 7 | print(list(longest)) -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/database/ten_more_countries.txt: -------------------------------------------------------------------------------- 1 | ID,Country,Area 2 | 51,Spain,499401 3 | 52,Turkmenistan,488100 4 | 53,Cameroon,469440 5 | 54,Papua New Guinea,451709 6 | 55,Uzbekistan,447400 7 | 56,Morocco,446301 8 | 57,Iraq,433970 9 | 58,Sweden,411621 10 | 59,Paraguay,397301 11 | 60,Japan,394744 12 | -------------------------------------------------------------------------------- /15.Python Decorators - JM/03.Decorators with Arguments/decorator_with_args_kwargs.py: -------------------------------------------------------------------------------- 1 | def pfib(*args, **kwargs): 2 | print(args) 3 | print(kwargs) 4 | 5 | 6 | def wrapper(*args, **kwargs): 7 | print("In wrapper function.") 8 | print(*args) 9 | pfib(*args, **kwargs) 10 | 11 | 12 | if __name__ == "__main__": 13 | wrapper(1, 1, th=2) 14 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/11.Regular Expressions/email_validation.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | string = 'test@test25.com' 4 | 5 | pattern = re.compile(r"(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)") 6 | 7 | result = pattern.match(string) 8 | 9 | print(result.group()) 10 | 11 | 12 | result = pattern.search(string) 13 | 14 | print(result) -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/11.Regular Expressions/regular_expression1.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | string = 'search inside of this text please!' 4 | 5 | a = re.search('this',string) 6 | 7 | #span => show start and end indexes 8 | print(a.span()) 9 | 10 | #start => start index 11 | print(a.start()) 12 | print(a.end()) 13 | 14 | print(a.group()) -------------------------------------------------------------------------------- /Python DB-API/Python - PostgreSQL/tournament/tournament.sql: -------------------------------------------------------------------------------- 1 | -- Table definitions for the tournament project. 2 | -- 3 | -- Put your SQL 'create table' statements in this file; also 'create view' 4 | -- statements if you choose to use it. 5 | -- 6 | -- You can write comments in this file by starting them with two dashes, like 7 | -- these lines here. 8 | 9 | 10 | -------------------------------------------------------------------------------- /01.Complete Python Bootcamp - JP/demo.py: -------------------------------------------------------------------------------- 1 | # demo.py 2 | 3 | import useful_functions as uf 4 | 5 | scores = [88, 92, 79, 93, 85] 6 | 7 | mean = uf.mean(scores) 8 | curved = uf.add_five(scores) 9 | 10 | mean_c = uf.mean(curved) 11 | 12 | print("Scores:", scores) 13 | print("Original Mean:", mean, " New Mean:", mean_c) 14 | 15 | print(__name__) 16 | print(uf.__name__) -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/10.Looping/unlucky_numbers.py: -------------------------------------------------------------------------------- 1 | """ 2 | for 4 and 13, unlucky 3 | for even numbers, even 4 | for ood numbers, odd 5 | """ 6 | 7 | for num in range(21): 8 | if num == 4 or num == 13: 9 | print(f"{num} is UNLUCKY!") 10 | elif num%2 == 0: 11 | print(f"{num} is even.") 12 | else: 13 | print(f"{num} is odd.") -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/17.Machine Learning and Data Science/machine_learning_101.txt: -------------------------------------------------------------------------------- 1 | 1. Gather and Import data 2 | 2. Clean the data 3 | 3. Split the data. Training set / Testing set 4 | 4. Create the model 5 | 5. Check the output 6 | 6. Improve 7 | 8 | 9 | https://research.fb.com/blog/2018/05/the-facebook-field-guide-to-machine-learning-video-series/ -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/exercise_30.py: -------------------------------------------------------------------------------- 1 | # Question: Why do you get an error and how would you fix it? 2 | 3 | # def foo(a=2, b): 4 | # return a + b 5 | 6 | 7 | # Answer: 8 | def foo(b,a=2): 9 | return a + b 10 | 11 | print(foo(5)) 12 | 13 | # Always put non default parameters first followed by default ones. -------------------------------------------------------------------------------- /13.Learning Python Libraries/01.Learning Python Standard Library - KH/04.Python Date Time HTML/data/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Testing 7 | 8 | 9 | A wonderful day :) 10 | 11 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/04.Advanced Python Functional Programming/reduce.py: -------------------------------------------------------------------------------- 1 | #reduce 2 | from functools import reduce 3 | 4 | my_list = [1,2,3] 5 | your_list = (100,200,300) 6 | their_list = (1000,2000,3000) 7 | 8 | def accumulator(acc, item): 9 | print(acc, item) 10 | return acc + item 11 | 12 | print(reduce(accumulator, my_list, 0)) 13 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/07.Advanced Python Generators/fibonacci_numbers.py: -------------------------------------------------------------------------------- 1 | def fibonacci_generator(index): 2 | num1 = 0 3 | num2 = 1 4 | for i in range(index+1): 5 | yield num1 6 | total = num1 + num2 7 | num1 = num2 8 | num2 = total 9 | 10 | 11 | for item in fibonacci_generator(20): 12 | print(item) -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/17.Machine Learning and Data Science/ML_SmartyBrain_Project/squeezenet_weights_tf_dim_ordering_tf_kernels.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyadana/Python-Projects-Dojo/HEAD/03.Complete Python Developer - Zero to Mastery - AN/17.Machine Learning and Data Science/ML_SmartyBrain_Project/squeezenet_weights_tf_dim_ordering_tf_kernels.h5 -------------------------------------------------------------------------------- /11.Learning Python - JM/regular_exp.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | five_digit_zip = '98101' 4 | nine_digit_zip = '98101-0003' 5 | phone_number = '234-567-8901' 6 | 7 | five_digit_expression = r"\d{5}" 8 | 9 | print(re.search(five_digit_expression, five_digit_zip)) 10 | print(re.search(five_digit_expression, nine_digit_zip)) 11 | print(re.search(five_digit_expression, phone_number)) -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/03_Advanced_Techniques/form/scrapy.cfg: -------------------------------------------------------------------------------- 1 | # Automatically created by: scrapy startproject 2 | # 3 | # For more information about the [deploy] section see: 4 | # https://scrapyd.readthedocs.io/en/latest/deploy.html 5 | 6 | [settings] 7 | default = form.settings 8 | 9 | [deploy] 10 | #url = http://localhost:6800/ 11 | project = form 12 | -------------------------------------------------------------------------------- /00.Python Mini Projects/05.Email Slicer/email_slicer.py: -------------------------------------------------------------------------------- 1 | print('***** Welcome to Simple Email Slicer *****') 2 | email = input('Please enter your email address: ').strip() 3 | 4 | #test@gmail.com 5 | username = email[:email.find('@')] 6 | domain = email[email.find('@') + 1 :email.find('.')] 7 | 8 | print(f'\nHere is your username: {username}') 9 | print(f'Your email domain is {domain}') -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/01.Python Basics/list_patterns.py: -------------------------------------------------------------------------------- 1 | #range 2 | new_list = list(range(0,100)) 3 | print(new_list) 4 | print("\n") 5 | 6 | #join 7 | sentence = "!" 8 | new_sentence = sentence.join(["hello","I","am","JoJo"]) 9 | print(new_sentence) 10 | print("\n") 11 | 12 | new_sentence = " ".join(["hello","I","am","JoJo"]) 13 | print(new_sentence) -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/11.Regular Expressions/password_checker.py: -------------------------------------------------------------------------------- 1 | # at least 8 chars long 2 | # contains any sort of letters, numbers, $%#@ 3 | # has to end with number 4 | 5 | import re 6 | 7 | string = "ABdasdf3$@%0" 8 | 9 | pattern = re.compile(r"([A-Za-z0-9$%#@]{7,}[0-9])") 10 | 11 | result = pattern.fullmatch(string) 12 | 13 | print(result) -------------------------------------------------------------------------------- /07.Data Structures & Algorithms/Foundation Algorithms - Lynda/03.Recursion/countdown.py: -------------------------------------------------------------------------------- 1 | # use recursion to implement a countdown counter 2 | 3 | 4 | def countdown(x): 5 | if x == 0: 6 | print("Done!") 7 | return 8 | else: 9 | print(x, "...") 10 | x -= 1 11 | countdown(x) 12 | print("foo") 13 | 14 | 15 | countdown(5) 16 | -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/04_Acting_Human/locations/scrapy.cfg: -------------------------------------------------------------------------------- 1 | # Automatically created by: scrapy startproject 2 | # 3 | # For more information about the [deploy] section see: 4 | # https://scrapyd.readthedocs.io/en/latest/deploy.html 5 | 6 | [settings] 7 | default = locations.settings 8 | 9 | [deploy] 10 | #url = http://localhost:6800/ 11 | project = locations 12 | -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/04_Acting_Human/profiles/scrapy.cfg: -------------------------------------------------------------------------------- 1 | # Automatically created by: scrapy startproject 2 | # 3 | # For more information about the [deploy] section see: 4 | # https://scrapyd.readthedocs.io/en/latest/deploy.html 5 | 6 | [settings] 7 | default = profiles.settings 8 | 9 | [deploy] 10 | #url = http://localhost:6800/ 11 | project = profiles 12 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/03.Advanced Python Object Oriented Programming/21.1 Exercise Repl.py: -------------------------------------------------------------------------------- 1 | class SuperList(list): 2 | def __len__(self): 3 | return 1000 4 | 5 | super_list1 = SuperList() 6 | print(len(super_list1)) 7 | 8 | super_list1.append(5) 9 | super_list1.append(10) 10 | print(super_list1[0]) 11 | 12 | print(issubclass(SuperList,list)) -------------------------------------------------------------------------------- /11.Learning Python - JM/04.Working with Web Data/inetdata.py: -------------------------------------------------------------------------------- 1 | # 2 | # Example file for retrieving data from the internet 3 | # 4 | 5 | import urllib.request 6 | 7 | def main(): 8 | url = urllib.request.urlopen("https://www.google.com") 9 | print(f"Result: {url.getcode()}") 10 | 11 | data = url.read() 12 | print(data) 13 | 14 | if __name__ == "__main__": 15 | main() 16 | -------------------------------------------------------------------------------- /14.Learning Python Generators - JMQ/02.Using Generator as Context Manager/01.Building Context Manager using yield/incrementer.py: -------------------------------------------------------------------------------- 1 | # increment some property by 1 2 | 3 | from contextlib import contextmanager 4 | 5 | @contextmanager 6 | def simple_context_manager(obj): 7 | try: 8 | obj.some_property += 1 9 | yield 10 | finally: 11 | obj.some_property -= 1 -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/31.01.CSV File/csv_reader.py: -------------------------------------------------------------------------------- 1 | from csv import reader 2 | 3 | with open('fighters.csv') as file: 4 | csv_reader = reader(file) 5 | 6 | #to avoid getting the first line => Name is from Country 7 | next(csv_reader) 8 | 9 | for fighter in csv_reader: 10 | #each row is a list 11 | print(f'{fighter[0]} is from {fighter[1]}') -------------------------------------------------------------------------------- /13.Learning Python Libraries/01.Learning Python Standard Library - KH/01.Python Built In/01_05_Min_Max.py: -------------------------------------------------------------------------------- 1 | # Minimum and Maximum 2 | playerOneScore = 10 3 | playerTwoScore = 4 4 | 5 | print(min(playerOneScore, playerTwoScore)) 6 | 7 | print(max(1, 35, 1, 34)) 8 | 9 | print(min("Kathryn", "Katie")) 10 | print(min("Angela", "Bob")) 11 | 12 | print(max(playerOneScore, playerTwoScore)) 13 | -------------------------------------------------------------------------------- /13.Learning Python Libraries/01.Learning Python Standard Library - KH/04.Python Date Time HTML/01_getting_current_time.py: -------------------------------------------------------------------------------- 1 | # Datetime Module Part I 2 | from datetime import datetime 3 | 4 | now = datetime.now() 5 | print(now) 6 | print(now.date()) 7 | print(now.day) 8 | print(now.month) 9 | print(now.year) 10 | print(now.hour) 11 | print(now.min) 12 | print(now.second) 13 | print(now.time()) -------------------------------------------------------------------------------- /17.Python for Automation/04.Automating with APIs/02.working_with_API_keys.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import json 3 | 4 | base_url = "http://api.openweathermap.org/data/2.5/forecast" 5 | 6 | APP_ID = "your_own_id" 7 | parameters = {"appid": APP_ID, "q": "Singapore"} 8 | 9 | response = requests.get(base_url, params=parameters) 10 | print(json.dumps(json.loads(response.content), indent=1)) 11 | -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/03_Advanced_Techniques/form/form/items.py: -------------------------------------------------------------------------------- 1 | # Define here the models for your scraped items 2 | # 3 | # See documentation in: 4 | # https://docs.scrapy.org/en/latest/topics/items.html 5 | 6 | import scrapy 7 | 8 | 9 | class FormItem(scrapy.Item): 10 | # define the fields for your item here like: 11 | # name = scrapy.Field() 12 | pass 13 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/01.Python Basics/25. Exercise Password Checker.py: -------------------------------------------------------------------------------- 1 | print("----- Welcome to Password Checker -----") 2 | username = input("Enter your username: ") 3 | password = input ("Enter your password: ") 4 | length = len(password) 5 | masked_password = "*" * int(length) 6 | 7 | print(f"hi {username}, your password {masked_password} is {length} characters long.") -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/01_Basic_WebScraping/ietf_scraper/scrapy.cfg: -------------------------------------------------------------------------------- 1 | # Automatically created by: scrapy startproject 2 | # 3 | # For more information about the [deploy] section see: 4 | # https://scrapyd.readthedocs.io/en/latest/deploy.html 5 | 6 | [settings] 7 | default = ietf_scraper.settings 8 | 9 | [deploy] 10 | #url = http://localhost:6800/ 11 | project = ietf_scraper 12 | -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/04_Acting_Human/profiles/profiles/items.py: -------------------------------------------------------------------------------- 1 | # Define here the models for your scraped items 2 | # 3 | # See documentation in: 4 | # https://docs.scrapy.org/en/latest/topics/items.html 5 | 6 | import scrapy 7 | 8 | 9 | class ProfilesItem(scrapy.Item): 10 | # define the fields for your item here like: 11 | # name = scrapy.Field() 12 | pass 13 | -------------------------------------------------------------------------------- /19.XML and JSON/02.API Documentation with JSON and XML/01_Markdown/peanut_butter.md: -------------------------------------------------------------------------------- 1 | # Peanut Butter 2 | 3 | Peanut Butter is **delicious**. 4 | 5 | ## How to make 6 | 7 | 1. Crush peanuts 8 | 2. Spread on bread 9 | 10 | ## Types 11 | 12 | | Type | Kids like it or not | 13 | | ------- | ------------------- | 14 | | Smooth | like | 15 | | Crunchy | No | 16 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/02.Python Basics II/ternary_operator.py: -------------------------------------------------------------------------------- 1 | #Ternary Operator 2 | 3 | # condition_if_true if condition else condition_if_false 4 | is_friend = True 5 | can_message = "can message" if is_friend else "not allowed" 6 | print(can_message) 7 | 8 | is_friend2 = False 9 | can_message2 = "can message" if is_friend2 else "not allowed" 10 | print(can_message2) -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/04.Advanced Python Functional Programming/10.1 Exercise Repl.py: -------------------------------------------------------------------------------- 1 | from functools import reduce 2 | 3 | my_list = [5,4,3] 4 | 5 | #square 6 | print(my_list) 7 | print(list(map(lambda item: item**2,my_list))) 8 | 9 | #list sort by 2nd item 10 | a = [(0,2), (4,3), (9,9), (10,-1)] 11 | 12 | print(a) 13 | a.sort(key=lambda item: item[1]) 14 | print(a) -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/03_Advanced_Techniques/news_scraper/scrapy.cfg: -------------------------------------------------------------------------------- 1 | # Automatically created by: scrapy startproject 2 | # 3 | # For more information about the [deploy] section see: 4 | # https://scrapyd.readthedocs.io/en/latest/deploy.html 5 | 6 | [settings] 7 | default = news_scraper.settings 8 | 9 | [deploy] 10 | #url = http://localhost:6800/ 11 | project = news_scraper 12 | -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/04_Acting_Human/locations/locations/items.py: -------------------------------------------------------------------------------- 1 | # Define here the models for your scraped items 2 | # 3 | # See documentation in: 4 | # https://docs.scrapy.org/en/latest/topics/items.html 5 | 6 | import scrapy 7 | 8 | 9 | class LocationsItem(scrapy.Item): 10 | # define the fields for your item here like: 11 | # name = scrapy.Field() 12 | pass 13 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/12.Testing/addition.py: -------------------------------------------------------------------------------- 1 | def add(num1=0, num2=0): 2 | try: 3 | if num1 and num2: 4 | return int(num1) + int(num2) 5 | elif num1 == 0 or num2 == 0: 6 | return int(num1) + int(num2) 7 | else: 8 | return "Please enter numbers." 9 | except ValueError as err: 10 | return err 11 | -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/02_Learning_to_Crawl/article_crawler/scrapy.cfg: -------------------------------------------------------------------------------- 1 | # Automatically created by: scrapy startproject 2 | # 3 | # For more information about the [deploy] section see: 4 | # https://scrapyd.readthedocs.io/en/latest/deploy.html 5 | 6 | [settings] 7 | default = article_crawler.settings 8 | 9 | [deploy] 10 | #url = http://localhost:6800/ 11 | project = article_crawler 12 | -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/03_working_with_XML/businesscard.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Vivian Fong 5 | (415) 555-4567 6 | (800) 555-9876 7 | (510) 555-1234 8 | vivian@test.com 9 | 10 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/02.Python Basics II/scope and global keywords.py: -------------------------------------------------------------------------------- 1 | #Scope : how python refer the scope in order 2 | #1) - start with local 3 | #2) - parent local? 4 | #3) - global variable? 5 | #4) - python built in function 6 | total = 0 7 | 8 | def count(): 9 | global total 10 | total += 1 11 | return total 12 | 13 | 14 | count() 15 | count() 16 | print(count()) -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/PDFs Processing/pdf_merger.py: -------------------------------------------------------------------------------- 1 | import PyPDF2 2 | 3 | with open('pdfs/dummy.pdf','rb') as file1, open('pdfs/twopage.pdf','rb') as file2: 4 | merger = PyPDF2.PdfFileMerger() 5 | merger.merge(0,file1) 6 | merger.merge(1,file2) 7 | 8 | with open('pdfs/processed/merged.pdf','wb') as merged_file: 9 | merger.write(merged_file) -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/exercise_31.py: -------------------------------------------------------------------------------- 1 | # Question: Why is there an error in the code and how would you fix it? 2 | 3 | # def foo(a=1, b=2): 4 | # return a + b 5 | 6 | # x = foo - 1 7 | 8 | 9 | # Answer: 10 | def foo(a=1, b=2): 11 | return a + b 12 | 13 | x = foo() - 1 14 | print(x) 15 | 16 | # A function is called using bracket notation () . -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/exercise_42.py: -------------------------------------------------------------------------------- 1 | # Question: Print out in each line the sum of homologous items of the two sequences. 2 | 3 | a = [1, 2, 3] 4 | b = (4, 5, 6) 5 | 6 | # Expected output: 7 | 8 | # 5 9 | # 7 10 | # 9 11 | 12 | # Answer 1: 13 | for index,item in enumerate(a): 14 | print(a[index]+b[index]) 15 | 16 | # Answer 2: 17 | print(zip(a,b)) -------------------------------------------------------------------------------- /13.Learning Python Libraries/01.Learning Python Standard Library - KH/04.Python Date Time HTML/04_timer.py: -------------------------------------------------------------------------------- 1 | # Create a Timer with the Time module 2 | import time 3 | 4 | run = input("Start 10 seconds timer (yes) ? ") 5 | 6 | if run.upper() == "YES": 7 | counter = 0 8 | while counter != 10: 9 | print("> ", counter) 10 | time.sleep(1) 11 | counter += 1 12 | print("> ", counter) -------------------------------------------------------------------------------- /14.Learning Python Generators - JMQ/01.Generator Functions and Expressions/02.Generator Expression/01_list_comprehension_vs_generator_expression.py: -------------------------------------------------------------------------------- 1 | collection = ["gold", "silver", "bronze"] 2 | 3 | # list comprehension 4 | new_list = [item.upper for item in collection] 5 | 6 | # generator expression 7 | # it is similar to list comprehension, but use () round brackets 8 | my_gen = (item.upper for item in collection) -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/01_Basic_WebScraping/ietf_scraper/ietf_scraper/items.py: -------------------------------------------------------------------------------- 1 | # Define here the models for your scraped items 2 | # 3 | # See documentation in: 4 | # https://docs.scrapy.org/en/latest/topics/items.html 5 | 6 | import scrapy 7 | 8 | 9 | class IetfScraperItem(scrapy.Item): 10 | # define the fields for your item here like: 11 | # name = scrapy.Field() 12 | pass 13 | -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/02_Learning_to_Crawl/article_crawler/article_crawler/items.py: -------------------------------------------------------------------------------- 1 | # Define here the models for your scraped items 2 | # 3 | # See documentation in: 4 | # https://docs.scrapy.org/en/latest/topics/items.html 5 | 6 | import scrapy 7 | 8 | 9 | class Article(scrapy.Item): 10 | title = scrapy.Field() 11 | url = scrapy.Field() 12 | last_edited = scrapy.Field() 13 | -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 01-25/exercise_02.py: -------------------------------------------------------------------------------- 1 | #Question: What's wrong with the following script? 2 | a = 1 3 | _a = 2 4 | _a2 = 3 5 | 2a = 4 6 | 7 | # Answer: 8 | # Line 4 throws a SyntaxError because variables cannot start with a number. 9 | 10 | # Explanation: 11 | # Variable names must start with a letter or an underscore. Everything else will throw a SyntaxError. -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/04.Advanced Python Functional Programming/lambda.py: -------------------------------------------------------------------------------- 1 | #lambda expressions 2 | #lambda param : action 3 | 4 | from functools import reduce 5 | 6 | my_list = [1,2,3] 7 | 8 | print(my_list) 9 | 10 | print(list(map(lambda item: item * 2,my_list))) 11 | 12 | print(list(filter(lambda item: item%2 != 0,my_list))) 13 | 14 | print(reduce(lambda acc,item: acc+item,my_list)) -------------------------------------------------------------------------------- /11.Learning Python - JM/map.py: -------------------------------------------------------------------------------- 1 | names = ['Jerry', 'Kramer', 'Elaine', 'George', 'Newman'] 2 | 3 | # Use map to apply str.upper to each element in names 4 | names_map = map(str.upper, names) 5 | 6 | # Print the type of the names_map 7 | print(type(names_map)) 8 | 9 | # Unpack names_map into a list 10 | names_uppercase = [item for item in names_map] 11 | 12 | # Print the list created above 13 | print(names_uppercase) -------------------------------------------------------------------------------- /JSON with Python/states.py: -------------------------------------------------------------------------------- 1 | import json 2 | 3 | with open("states.json") as f: 4 | #load the file content into object 5 | data = json.load(f) 6 | 7 | for state in data['states']: 8 | #remove area-code element 9 | del state['area_codes'] 10 | 11 | 12 | # new_string = json.dumps(data,indent=2) 13 | # print(new_string) 14 | 15 | with open('new_states.json','w') as f: 16 | json.dump(data, f, indent=2) -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/02.Python Basics II/is vs ==.py: -------------------------------------------------------------------------------- 1 | print(True == 1) 2 | print('' == 1) 3 | print([] == 1) 4 | print(10 == 10.0) 5 | print([] == []) 6 | print([1,2,3] == [1,2,3]) 7 | 8 | print("-----------") 9 | 10 | print(True is 1) 11 | print(True is True) 12 | print('' is 1) 13 | print([] is 1) 14 | print(10 is 10.0) 15 | print([] is[]) 16 | print([1,2,3] is [1,2,3]) #different memory space -------------------------------------------------------------------------------- /17.Python for Automation/00.data/pass_list.txt: -------------------------------------------------------------------------------- 1 | Mary 25 P 2 | John 32 P 3 | Hailey 26 P 4 | Iris 23 P 5 | Jacob 29 P 6 | Jamie 26 P 7 | Chloe 21 P 8 | Natalie 29 P 9 | David 23 P 10 | Mario 51 P 11 | Josh 39 P 12 | Kayla 28 P 13 | Hunter 61 P 14 | Erica 16 P 15 | Kyle 19 P 16 | Rosanna 45 P 17 | Joy 28 P 18 | Jim 67 P 19 | Sansa 28 P 20 | Juan 73 P 21 | Colin 59 P 22 | Kate 58 P 23 | Jade 26 P 24 | River 29 P 25 | Chris 31 P 26 | -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/03_Advanced_Techniques/news_scraper_challenge/scrapy.cfg: -------------------------------------------------------------------------------- 1 | # Automatically created by: scrapy startproject 2 | # 3 | # For more information about the [deploy] section see: 4 | # https://scrapyd.readthedocs.io/en/latest/deploy.html 5 | 6 | [settings] 7 | default = news_scraper_challenge.settings 8 | 9 | [deploy] 10 | #url = http://localhost:6800/ 11 | project = news_scraper_challenge 12 | -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/07_xslt_examples/01_03_simpletransform.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: Arial, Helvetica, sans-serif; 3 | background-color: #DACFE5; 4 | margin: 5px; 5 | text-align: left; 6 | color: #523819; 7 | } 8 | 9 | h1 { 10 | font-size: 140%; 11 | color: #0D3427; 12 | margin: 10px; 13 | } 14 | 15 | img { 16 | float: left; 17 | margin-left: 10px; 18 | margin-right: 10px; 19 | border: 0px; 20 | } 21 | -------------------------------------------------------------------------------- /19.XML and JSON/02.API Documentation with JSON and XML/03_XML/weather_oneday.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2021-03-09 5 | sunny 6 | 38 7 | 20 8 | 12 9 | false 10 | 11 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/02.Python Basics II/34.1 Exercise Repl.py: -------------------------------------------------------------------------------- 1 | # Scope - what variables do I have access to? 2 | def outer(): 3 | x = "local" 4 | def inner(): 5 | nonlocal x 6 | x = "nonlocal" 7 | print("inner:", x) 8 | inner() 9 | print("outer:", x) 10 | outer() 11 | 12 | #1 - start with local 13 | #2 - Parent local? 14 | #3 - global 15 | #4 - built in python functions -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/06.Advanced Python Error Handling/error_handling.py: -------------------------------------------------------------------------------- 1 | print("Welcome..") 2 | 3 | while True: 4 | try: 5 | age = int(input("What is your age? ")) 6 | except ValueError: 7 | print("Please enter a number") 8 | except ZeroDivisionError: 9 | print("Please enter the age higher than zero.") 10 | else: 11 | print("Thank you.") 12 | break 13 | -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/23.HTTP_Requests/joke_request.py: -------------------------------------------------------------------------------- 1 | #Library Used: requests 2 | #https://requests.readthedocs.io/en/master/ 3 | 4 | import requests 5 | 6 | url = 'https://icanhazdadjoke.com' 7 | 8 | # plain text 9 | # response = requests.get(url, headers={'Accept':'text/plain'}) 10 | 11 | # JSON 12 | response = requests.get(url, headers={'Accept':'application/json'}) 13 | data = response.json() 14 | print(data['joke']) 15 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/01.Python Basics/dictionaries_keys.py: -------------------------------------------------------------------------------- 1 | #Dictionary Keys must be hashable : An object is said to be hashable if it has a hash value that remains the same during its lifetime. 2 | #which means immutable, such as int, string, booleans etc 3 | 4 | dict = { 5 | 123: [1,2,3], 6 | 'A': "ABC", 7 | True: "hello", 8 | } 9 | 10 | print(dict[123]) 11 | print(dict['A']) 12 | print(dict[True]) -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 01-25/exercise_12.py: -------------------------------------------------------------------------------- 1 | # Question: Complete the script so that it produces the expected output. Please use my_range as input data. 2 | 3 | my_range = range(1, 21) 4 | 5 | # Expected output: 6 | # [10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200] 7 | 8 | # Answer: 9 | final_list = [item*10 for item in my_range] 10 | print(final_list) -------------------------------------------------------------------------------- /05.More Python - Microsoft/07.working_with_files_manage.py: -------------------------------------------------------------------------------- 1 | stream = open('./manage.txt','wt') 2 | 3 | #write the word demo! to the stream 4 | stream.write('demo!') 5 | 6 | #move back to the start of the file 7 | stream.seek(0) 8 | 9 | #write the word cool to the stream 10 | stream.write('cool') 11 | 12 | #flush the file stream contents to the buffer 13 | stream.flush() 14 | 15 | #flush the file stream and close the file 16 | stream.close() 17 | -------------------------------------------------------------------------------- /07.Data Structures & Algorithms/Foundation Algorithms - Lynda/02.Data Structures/stack.py: -------------------------------------------------------------------------------- 1 | # try out the Python stack functions 2 | 3 | # create a new empty stack 4 | stack = [] 5 | 6 | # push items onto the stack 7 | stack.append(1) 8 | stack.append(2) 9 | stack.append(3) 10 | stack.append(4) 11 | 12 | # print the stack contents 13 | print(stack) 14 | 15 | # pop an item off the stack 16 | item = stack.pop() 17 | print(item) 18 | print(stack) -------------------------------------------------------------------------------- /14.Learning Python Generators - JMQ/03.Coroutines/04.Coroutine Pipelines/coroutine_decorator_example.py: -------------------------------------------------------------------------------- 1 | # Coroutine Decorator 2 | # by implmenting decorator and using this decorator allow us to get pre-primed coroutine object 3 | # which we can immediately send values 4 | 5 | def coroutine_decorator(func): 6 | def wrap(*args, **kwargs): 7 | cr = func(*args, **kwargs) 8 | cr.__next__() 9 | return cr 10 | return wrap -------------------------------------------------------------------------------- /01.Complete Python Bootcamp - JP/test.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | import Cap 3 | 4 | class TestCap(unittest.TestCase): 5 | 6 | def test_one_word(self): 7 | text = 'python' 8 | result = Cap.cap_text(text) 9 | self.assertEqual(result,'Python') 10 | 11 | def test_multiplewords(self): 12 | text = 'monty python' 13 | result = Cap.cap_text(text) 14 | self.assertEqual(result,'Monty Python') 15 | 16 | if __name__ == '__main__': 17 | unittest.main() -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/05.Advanced Python Decorators/decorators3.py: -------------------------------------------------------------------------------- 1 | #Decorator Pattern 2 | def my_decorator(func): 3 | def wrap_func(*args, **kwargs): 4 | print("**********") 5 | func(*args, **kwargs) 6 | print("**********") 7 | return wrap_func 8 | 9 | @my_decorator 10 | def hello(greeting,emoji, withLove="your love"): 11 | print(greeting,emoji, withLove) 12 | 13 | hello('yo yo', '<3') -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/exercise95.py: -------------------------------------------------------------------------------- 1 | # Create a program that asks the user to input values separated by commas 2 | # and stores those values in a text file, each value in a separate line. 3 | 4 | data = input('Please enter any value seperated with , comma : ').split(','); 5 | print(data) 6 | with open('./95_file/95_file.txt', 'w') as file: 7 | for value in data: 8 | file.write(value+'\n'); 9 | -------------------------------------------------------------------------------- /14.Learning Python Generators - JMQ/03.Coroutines/03.Consume Value in send method/coroutine_decorator_example.py: -------------------------------------------------------------------------------- 1 | # Coroutine Decorator 2 | # by implmenting decorator and using this decorator allow us to get pre-primed coroutine object 3 | # which we can immediately send values 4 | 5 | def coroutine_decorator(func): 6 | def wrap(*args, **kwargs): 7 | cr = func(*args, **kwargs) 8 | cr.__next__() 9 | return cr 10 | return wrap -------------------------------------------------------------------------------- /19.XML and JSON/02.API Documentation with JSON and XML/01_Markdown/markdown_exercise.md: -------------------------------------------------------------------------------- 1 | # Status Codes 2 | 3 | Every web request returns a _status code_ that says whether it was sucdcessful or had an error. The most famous status code is `404`. 4 | 5 | ## Common codes 6 | 7 | | **Code** | **Description** | 8 | | -------- | --------------- | 9 | | 200 | OK | 10 | | 403 | Forbidden | 11 | | 404 | Not Found | 12 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/01.Python Basics/sets.py: -------------------------------------------------------------------------------- 1 | #set is the unordered collection of UNIQUE objects 2 | my_set = {1,2,3,4,5,5,5,5,5} 3 | 4 | print(my_set) 5 | 6 | my_set.add(100) 7 | print(my_set) 8 | 9 | my_set.add(50) 10 | print(my_set) 11 | 12 | my_list = [1,2,3,4,5,5,5,5,5] 13 | unique_set = set(my_list) 14 | print(unique_set) 15 | 16 | 17 | my_set.add(200) 18 | print(my_set) 19 | my_set.remove(100) 20 | print(my_set) 21 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/08.Modules In Python/module_example.py: -------------------------------------------------------------------------------- 1 | print(__name__) 2 | 3 | import module_utilities 4 | # from shopping import shopping_cart 5 | from shopping.shopping_cart import buy 6 | 7 | if __name__ == "__main__": 8 | print(module_utilities.multiply(10,2)) 9 | print(module_utilities.divide(100,2)) 10 | 11 | # print(shopping_cart.buy("apple")) 12 | 13 | #cleaner version 14 | print(buy("apple")) -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/exercise93.py: -------------------------------------------------------------------------------- 1 | # Please download the attached ZIP file. Inside the ZIP file there's a directory named subdirs. 2 | # That directory contains other directories inside. Please write a script 3 | # that counts the number of .py files contained inside subdirs and all its sub-directories. 4 | import glob 5 | 6 | file_list = glob.glob("./93_files/**/*.py", recursive=True) 7 | print(len(file_list)) -------------------------------------------------------------------------------- /05.More Python - Microsoft/06.managing_file_path.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | 3 | 4 | #get current working directory 5 | cwd = Path.cwd() 6 | print(f'\nCurrent Working Directory\n{cwd}') 7 | 8 | #full path name of a file 9 | new_file_path = Path.joinpath(cwd, 'new_text.txt') 10 | print(f'\nFull Path of a file\n{new_file_path}') 11 | 12 | #Does file exist? 13 | file_exist = Path.exists(new_file_path) 14 | print(f'\nDoes file exist?\n{file_exist}') 15 | -------------------------------------------------------------------------------- /05.More Python - Microsoft/07.working_with_files_write.py: -------------------------------------------------------------------------------- 1 | stream = open('./output.txt', mode='wt') 2 | 3 | print('\nCan I write to the file? ' + str(stream.writable())) 4 | 5 | stream.write('H') #write char 'H' 6 | stream.writelines(['ello', ' ', 'World!']) #write one or more strings or any objects whatever is iterable or iterators 7 | stream.write('\n') 8 | 9 | names = ['Richard', 'Vivian'] 10 | stream.writelines('\n'.join(names)) 11 | 12 | stream.close() -------------------------------------------------------------------------------- /12.Python Object Oriented Programming - JM/01.OOP/definition.py: -------------------------------------------------------------------------------- 1 | # Python Object Oriented Programming by Joe Marini course example 2 | # Basic class definitions 3 | 4 | 5 | # create a basic class 6 | class Book(): 7 | def __init__(self, title): 8 | self.title = title 9 | 10 | # create instances of the class 11 | b1 = Book("Flip it!") 12 | b2 = Book("Positive Dog") 13 | 14 | # print the class and property 15 | print(b1) 16 | print(b1.title) -------------------------------------------------------------------------------- /13.Learning Python Libraries/01.Learning Python Standard Library - KH/03.Python Input Output/05_iterative_files.py: -------------------------------------------------------------------------------- 1 | # Iterative Files 2 | myFile = open("data/scores.txt", "r") 3 | 4 | # Read one line at a time 5 | print("My one line: ", myFile.readline()) 6 | 7 | myFile.seek(0) 8 | 9 | # Iterate through each line of a file 10 | for line in myFile: 11 | newHighScorer = line.replace("BBB", "PDJ") 12 | print(newHighScorer) 13 | 14 | myFile.close() -------------------------------------------------------------------------------- /11.Learning Python - JM/03.Working with Files/test.txt: -------------------------------------------------------------------------------- 1 | This is line 0 2 | This is line 1 3 | This is line 2 4 | This is line 3 5 | This is line 4 6 | This is line 5 7 | This is line 6 8 | This is line 7 9 | This is line 8 10 | This is line 9 11 | This is line 0 12 | This is line 1 13 | This is line 2 14 | This is line 3 15 | This is line 4 16 | This is line 5 17 | This is line 6 18 | This is line 7 19 | This is line 8 20 | This is line 9 21 | -------------------------------------------------------------------------------- /11.Learning Python - JM/03.Working with Files/test2.txt: -------------------------------------------------------------------------------- 1 | This is line 0 2 | This is line 1 3 | This is line 2 4 | This is line 3 5 | This is line 4 6 | This is line 5 7 | This is line 6 8 | This is line 7 9 | This is line 8 10 | This is line 9 11 | This is line 0 12 | This is line 1 13 | This is line 2 14 | This is line 3 15 | This is line 4 16 | This is line 5 17 | This is line 6 18 | This is line 7 19 | This is line 8 20 | This is line 9 21 | -------------------------------------------------------------------------------- /13.Learning Python Libraries/01.Learning Python Standard Library - KH/04.Python Date Time HTML/02_format_date_time.py: -------------------------------------------------------------------------------- 1 | # Getting more control over formatting 2 | from datetime import datetime 3 | 4 | now = datetime.now() 5 | 6 | print(now.strftime("%a %A %d")) 7 | 8 | print(now.strftime("%b %B %m")) 9 | 10 | print(now.strftime("%a %B %d")) 11 | print(now.strftime("%A %B %d")) 12 | 13 | print(now.strftime("%H:%M:%S %p")) 14 | 15 | print(now.strftime("%y %Y")) -------------------------------------------------------------------------------- /16.Functional Programming with Python - SW/02.Python - Functional Parts/lambda.py: -------------------------------------------------------------------------------- 1 | numbers_list = range(10) 2 | 3 | # simple lambda 4 | # add = lambda x, y : x+y 5 | # print(add) 6 | 7 | doubled_numbers = list(map(lambda x: x*2, numbers_list)) 8 | print(doubled_numbers) 9 | 10 | 11 | # using lambda for multiplier 12 | def multiplier(multipler_num): 13 | return lambda x: x * multipler_num 14 | 15 | 16 | doubled = multiplier(2) 17 | print(doubled(4)) 18 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/02.Python Basics II/nonlocal keyword.py: -------------------------------------------------------------------------------- 1 | def outer(): 2 | x = "local" 3 | 4 | def inner(): 5 | #by using nonlocal keyword, x variable is referenced from parent one 6 | nonlocal x 7 | 8 | #now the parent variable x got overwritten 9 | x = "nonlocal" 10 | 11 | print(f"inner: {x}") 12 | 13 | inner() 14 | print(f"outer: {x}") 15 | 16 | 17 | outer() -------------------------------------------------------------------------------- /05.More Python - Microsoft/06.managing_file_files.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | 3 | cwd = Path.cwd() 4 | 5 | test_file = Path.joinpath(cwd, 'test.txt') 6 | 7 | #get the file name 8 | print(f'\nFile name\n{test_file.name}') 9 | 10 | #get the extension 11 | print(f'\nFile Suffix\n{test_file.suffix}') 12 | 13 | #get the folder 14 | print(f'\nFile folder\n{test_file.parent}') 15 | 16 | #get the file size 17 | print(f'\nFile size\n{test_file.stat().st_size}') 18 | -------------------------------------------------------------------------------- /14.Learning Python Generators - JMQ/01.Generator Functions and Expressions/04.Fibonacci Sequence Challenge/fibonacci_generator_short_version.py: -------------------------------------------------------------------------------- 1 | def fibonacci_geneator(): 2 | trailing, lead = 0, 1 3 | while True: 4 | yield lead 5 | trailing, lead = lead, trailing+lead 6 | 7 | 8 | 9 | if __name__ == "__main__": 10 | fib = fibonacci_geneator() 11 | 12 | for item in range(15): 13 | print(fib.__next__()) -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/01.Python Basics/list_methods3.py: -------------------------------------------------------------------------------- 1 | basket = ["a","c","e","b","d"] 2 | #sort 3 | basket.sort() 4 | print(basket) 5 | 6 | #sorted() sorts and return as new list 7 | basket = ["x","c","e","b","d", "a", "y"] 8 | print(sorted(basket)) 9 | print(basket) 10 | 11 | new_basket = sorted(basket) 12 | print(new_basket) 13 | 14 | #reverse 15 | new_basket.reverse() 16 | print(new_basket) 17 | 18 | print(new_basket[::-1]) 19 | 20 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/04.Advanced Python Functional Programming/list_comprehension.py: -------------------------------------------------------------------------------- 1 | my_list = [char for char in 'hello'] 2 | print(my_list) 3 | 4 | #0 - 99 5 | my_list2 = [num for num in range(0,100)] 6 | print(my_list2) 7 | 8 | #square of 0-99 9 | my_list3 = [num**2 for num in range(0,100)] 10 | print(my_list3) 11 | 12 | #only even number of (square of 0-99) 13 | my_list4 = [num**2 for num in range(0,100) if num%2 == 0] 14 | print(my_list4) -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/04.Advanced Python Functional Programming/set_comprehension.py: -------------------------------------------------------------------------------- 1 | my_list = {char for char in 'hello'} 2 | print(my_list) 3 | 4 | #0 - 99 5 | my_list2 = {num for num in range(0,100)} 6 | print(my_list2) 7 | 8 | #square of 0-99 9 | my_list3 = {num**2 for num in range(0,100)} 10 | print(my_list3) 11 | 12 | #only even number of (square of 0-99) 13 | my_list4 = {num**2 for num in range(0,100) if num%2 == 0} 14 | print(my_list4) -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/11.Regular Expressions/regular_expression2.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | string = 'search inside of this text please!' 4 | 5 | pattern = re.compile(r"([a-zA-z]).([a])") 6 | 7 | a = pattern.search(string) 8 | b = pattern.findall(string) 9 | c = pattern.fullmatch(string) 10 | d = pattern.match(string) 11 | 12 | print(a) 13 | print(b) 14 | print(c) 15 | print(d) 16 | 17 | print("---------------") 18 | print(a.group()) 19 | 20 | -------------------------------------------------------------------------------- /05.More Python - Microsoft/03.properties_class.py: -------------------------------------------------------------------------------- 1 | class Presenter(): 2 | def __init__(self, name): 3 | self.name = name 4 | 5 | @property 6 | def name(self): 7 | print('in the getter') 8 | return self.__name 9 | 10 | @name.setter 11 | def name(self, value): 12 | print('in the setter') 13 | self.__name = value 14 | 15 | presenter = Presenter('Chris') 16 | presenter.name = 'Christopher' 17 | print(presenter.name) -------------------------------------------------------------------------------- /10.Python Code Challenges/Level_01/04_sort_words.py: -------------------------------------------------------------------------------- 1 | """ 2 | Input: string of words seperated by space 3 | Output: string of alphabitacally sorted words 4 | consider lower and upper case letters as the same (such as Apple and apple) 5 | """ 6 | 7 | def sort_words(words): 8 | lst = words.split(" ") 9 | lst.sort(key=str.lower) 10 | return " ".join(lst) 11 | 12 | if __name__ == "__main__": 13 | result = sort_words("ORANGE banana apple") 14 | print(result) -------------------------------------------------------------------------------- /19.XML and JSON/01.XML Essential/08_document_type_definition_dtd/businesscard_dtd_as_external.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Vivian Fong 6 | (415) 555-4567 7 | (800) 555-9876 8 | (510) 555-1234 9 | (425) 555-8989 10 | vivian@test.com 11 | 12 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/04.Advanced Python Functional Programming/dictionary_comprehension.py: -------------------------------------------------------------------------------- 1 | simple_dict = { 2 | 'a':1, 3 | 'b':2 4 | } 5 | 6 | my_dict = {k:v**2 for k,v in simple_dict.items()} 7 | print(my_dict) 8 | 9 | #only even number 10 | my_dict = {k:v**2 for k,v in simple_dict.items() if v%2 == 0} 11 | print(my_dict) 12 | 13 | 14 | print("------------------") 15 | 16 | my_dict = {num:num*2 for num in [1,2,3]} 17 | print(my_dict) -------------------------------------------------------------------------------- /16.Functional Programming with Python - SW/01.First Class Functions/passing_functions_as_arg_calculation.py: -------------------------------------------------------------------------------- 1 | def add(x, y): 2 | return x + y 3 | 4 | 5 | def subtract(x, y): 6 | return x - y 7 | 8 | 9 | # combined function : pssing function as argument 10 | def combine_2_and_3(func): 11 | return func(2, 3) 12 | 13 | 14 | print(combine_2_and_3(add)) 15 | print(combine_2_and_3(subtract)) 16 | 17 | print(combine_2_and_3(min)) 18 | print(combine_2_and_3(max)) 19 | -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/23.HTTP_Requests/joke_request_params.py: -------------------------------------------------------------------------------- 1 | #Library Used: requests 2 | #https://requests.readthedocs.io/en/master/ 3 | 4 | import requests 5 | 6 | url = 'https://icanhazdadjoke.com/search' 7 | 8 | response = requests.get( 9 | url, 10 | headers={'Accept':'application/json'}, 11 | params={'term':'cat', 'limit':'1'} 12 | ) 13 | 14 | data = response.json() 15 | print(data) 16 | # print(data['joke']) 17 | -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/31.01.CSV File/csv_writer.py: -------------------------------------------------------------------------------- 1 | from csv import reader,writer 2 | 3 | with open('fighters.csv') as file: 4 | csv_reader = reader(file) 5 | fighters = [[item.upper() for item in row] for row in csv_reader] 6 | for fighter in fighters: 7 | print(fighter) 8 | 9 | with open('capatalized_fighters.csv','w', newline='') as file: 10 | csv_writer = writer(file) 11 | for fighter in fighters: 12 | csv_writer.writerow(fighter) -------------------------------------------------------------------------------- /07.Data Structures & Algorithms/Foundation Algorithms - Lynda/01.Common Algorithms/gcd.py: -------------------------------------------------------------------------------- 1 | # Find the greatest common denominator of two numbers 2 | # using Eculid's algorithms 3 | 4 | def get_gcd(a, b): 5 | 6 | while b != 0: 7 | temp = a 8 | a = b 9 | b = temp % b 10 | 11 | return a 12 | 13 | if __name__ == "__main__": 14 | print("Greatest Common Denominator: ", get_gcd(20, 8)) 15 | print("Greatest Common Denominator: ", get_gcd(60, 96)) -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/06.Numbers, Operators, and Comments/operators.py: -------------------------------------------------------------------------------- 1 | x = 10 2 | y = 3 3 | 4 | exponential_result = x**3 5 | print(f'Expontential Result:{exponential_result}') 6 | 7 | normal_division_result = x/y 8 | 9 | #intger division floors the result down 10 | integer_division_result = x//y 11 | 12 | print(f'Normal Division:{normal_division_result}') 13 | print(f'Integer Division:{integer_division_result}') 14 | 15 | friend, cat, dogs = 10, 50, 60 16 | print(friend) -------------------------------------------------------------------------------- /13.Learning Python Libraries/01.Learning Python Standard Library - KH/01.Python Built In/01_04_Range_List.py: -------------------------------------------------------------------------------- 1 | # Range -> range instance that holds all nums counting by one between 0 and first input 2 | # List -> lists numbers from the inputted tuple 3 | 4 | numberedContestants = range(30) 5 | 6 | print(list(numberedContestants)) 7 | 8 | for c in list(numberedContestants): 9 | print(f"Contestant {c} is here.") 10 | 11 | lucky_winners = range(7, 30, 5) 12 | print(list(lucky_winners)) -------------------------------------------------------------------------------- /13.Learning Python Libraries/01.Learning Python Standard Library - KH/03.Python Input Output/06_temp_file.py: -------------------------------------------------------------------------------- 1 | # Tempfile Module 2 | import tempfile 3 | 4 | # Create a temporary file 5 | tempFile = tempfile.TemporaryFile() 6 | 7 | # Write to a temporary file 8 | tempFile.write(b"Save this special number for me: 234345") #writing as bytes string 9 | 10 | tempFile.seek(0) 11 | # Read the temporary file 12 | print(tempFile.read()) 13 | 14 | # Close the temporary file 15 | tempFile.close() -------------------------------------------------------------------------------- /10.Python Code Challenges/Level_02/04.alarm.py: -------------------------------------------------------------------------------- 1 | """ 2 | Input: alarm time, sound file, message 3 | Output: set off alarm 4 | """ 5 | 6 | import winsound 7 | import time 8 | import datetime 9 | 10 | def set_alarm(time_in_seconds, sound_file_path, message): 11 | time.sleep(time_in_seconds) 12 | winsound.PlaySound(sound_file_path, winsound.SND_FILENAME) 13 | print(message) 14 | 15 | 16 | if __name__ == "__main__": 17 | set_alarm(5, "rooster2.wav", "Good Morning... Wake up..") -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/01.Python Basics/9.1.Exercise Operator Precedence.py: -------------------------------------------------------------------------------- 1 | # Guess the output of each answer before you click RUN 2 | # Try to write down your answer before and see how you do... keep it mind I made it a little tricky for you :) 3 | 4 | print((5 + 4) * 10 / 2) 5 | 6 | print(((5 + 4) * 10) / 2) 7 | 8 | print((5 + 4) * (10 / 2)) 9 | 10 | print(5 + (4 * 10) / 2) 11 | 12 | print(5 + 4 * 10 // 2) 13 | 14 | #45.0 15 | #45.0 16 | #45.0 17 | #25.0 18 | #25 -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/02.Python Basics II/iterables.py: -------------------------------------------------------------------------------- 1 | #iterable: string, list, dictionary, tuple, sets 2 | #iterate: one by one checking each item in the collection. 3 | 4 | user = { 5 | 'name':'deadpool', 6 | 'age':45, 7 | 'power':'immortality' 8 | } 9 | 10 | for key,value in user.items(): 11 | print(f"key: {key} and value : {value}" ) 12 | 13 | for key in user.keys(): 14 | print(key) 15 | 16 | for value in user.values(): 17 | print(value) -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 01-25/exercise_16.py: -------------------------------------------------------------------------------- 1 | # Question: Please complete the script so that it prints out the value of key b . 2 | 3 | d = {"a": 1, "b": 2} 4 | 5 | # Expected output: 6 | # 2 7 | 8 | #Answer 9 | print(d['b']) 10 | 11 | # Explanation: 12 | # As you see, accessing dictionary values follows the same syntax as accessing list items. The difference is that lists have indexes, while dictionaries have keys which you create by yourself. -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/exercise_33.py: -------------------------------------------------------------------------------- 1 | # Question: Here's another similar exercise. What will the following script output? Try to do this mentally if you can. 2 | 3 | c = 1 4 | def foo(): 5 | c = 2 6 | return c 7 | 8 | c = 3 9 | print(foo()) 10 | 11 | # Answer: 2 12 | # Hint: Note that c is a local variable that exists only inside the function. The other two c variables are global variables and have nothing to do with the function. -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/exercise89.py: -------------------------------------------------------------------------------- 1 | #from database.db, print out those countries with an area of greater than 2,000, 000. 2 | 3 | import sqlite3 4 | 5 | conn = sqlite3.connect('database/database.db'); 6 | c = conn.cursor(); 7 | 8 | c.execute('SELECT * FROM countries WHERE area >= 2000000;'); 9 | results = c.fetchall(); 10 | 11 | for country in results: 12 | print(",".join(str(data) for data in country)) 13 | 14 | c.close(); 15 | 16 | -------------------------------------------------------------------------------- /16.Functional Programming with Python - SW/01.First Class Functions/basic_fetch_data.py: -------------------------------------------------------------------------------- 1 | ENVIRNOMENT = "dev" 2 | 3 | 4 | def fetch_data_real(): 5 | print("doing some time intensive operations...") 6 | 7 | 8 | def fetch_data_fake(): 9 | print("returning fake data...") 10 | return { 11 | "name": "Jane Doe", 12 | "age": 32 13 | } 14 | 15 | 16 | fetch_data = fetch_data_real if ENVIRNOMENT == 'prod' else fetch_data_fake 17 | data = fetch_data() 18 | print(data) 19 | -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/03_Advanced_Techniques/form/form/pipelines.py: -------------------------------------------------------------------------------- 1 | # Define your item pipelines here 2 | # 3 | # Don't forget to add your pipeline to the ITEM_PIPELINES setting 4 | # See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html 5 | 6 | 7 | # useful for handling different item types with a single interface 8 | from itemadapter import ItemAdapter 9 | 10 | 11 | class FormPipeline: 12 | def process_item(self, item, spider): 13 | return item 14 | -------------------------------------------------------------------------------- /Python DB-API/Python - PostgreSQL/forum/solution/forumdb_initial.py: -------------------------------------------------------------------------------- 1 | # "Database code" for the DB Forum. 2 | 3 | import datetime 4 | 5 | POSTS = [("This is the first post.", datetime.datetime.now())] 6 | 7 | def get_posts(): 8 | """Return all posts from the 'database', most recent first.""" 9 | return reversed(POSTS) 10 | 11 | def add_post(content): 12 | """Add a post to the 'database' with the current timestamp.""" 13 | POSTS.append((content, datetime.datetime.now())) 14 | 15 | 16 | -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/13.Lists Comprehensions/list_comprehensions_with_logic.py: -------------------------------------------------------------------------------- 1 | numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] 2 | 3 | even = [num for num in numbers if num%2 == 0] 4 | print(even) 5 | 6 | # even odd checker 7 | results = [f"{num} - even" if num%2 == 0 else f"{num} - odd" for num in numbers] 8 | print(results) 9 | 10 | # vowel filter (no vowel) 11 | my_string = "This is so much fun !" 12 | results = "".join(char for char in my_string if char not in "aeiou") 13 | print(results) -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/06.Advanced Python Error Handling/error_handling3.py: -------------------------------------------------------------------------------- 1 | print("Welcome....") 2 | 3 | while True: 4 | try: 5 | age = int(input("What is your age? ")) 6 | age / 0 7 | raise ZeroDivisionError("Yo Yo customed error !!!") 8 | 9 | except ValueError: 10 | print("Please enter a number") 11 | break 12 | else: 13 | print("Thank you.") 14 | break 15 | finally: 16 | print("finally.") 17 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/07.Advanced Python Generators/generator.py: -------------------------------------------------------------------------------- 1 | #generator 2 | #yeild pause the function and give the value 3 | #generator doesn't store the value in memory which is different like using a list 4 | #if we are using a list, list store the values in memory which might take resources and more time to process 5 | def generator_function(num): 6 | for i in range(num): 7 | yield i 8 | 9 | for item in generator_function(100): 10 | print(item) 11 | -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 01-25/exercise_18.py: -------------------------------------------------------------------------------- 1 | # Exercise for reference: 2 | 3 | d = {"Name": "John", "Surname": "Smith"} 4 | 5 | print(d["Smith"]) 6 | 7 | # Answer: 8 | # There is no key Smith in the dictionary. Smith is a value. You want to use Surname if you want to access Smith : 9 | 10 | # print(d["Surname"]) 11 | 12 | # Explanation: 13 | # A KeyError always means Python could not find a key with the name shown next to KeyError (e.g. Smith ). -------------------------------------------------------------------------------- /09.Automate the Boring Stuffs with Python Projects - AS/Chapter 4 – Lists/comma_code.py: -------------------------------------------------------------------------------- 1 | def convertString(lst): 2 | st = "" 3 | for index in range(len(lst) - 1): 4 | st += lst[index] + ", " 5 | 6 | return st + lst[len(lst) - 1] 7 | 8 | def main(): 9 | spam = ['apples', 'bananas', 'tofu', 'cats'] 10 | st = convertString(spam) 11 | print(st) 12 | 13 | #using python builtin join 14 | print(", ".join(spam)) 15 | 16 | if __name__ == "__main__": 17 | main() -------------------------------------------------------------------------------- /16.Functional Programming with Python - SW/01.First Class Functions/closure_basic_print.py: -------------------------------------------------------------------------------- 1 | def create_printer(): 2 | my_favourite_number = 123 3 | 4 | def printer(): 5 | print(f"My Favourite Number is {my_favourite_number}") 6 | return printer 7 | 8 | 9 | # Closure 10 | # As we can see, the output will be 123. Which means my_printer can still access to my_favourite_number which is outer scope. 11 | # this is what Closure is 12 | my_printer = create_printer() 13 | my_printer() 14 | -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/04_Acting_Human/locations/locations/pipelines.py: -------------------------------------------------------------------------------- 1 | # Define your item pipelines here 2 | # 3 | # Don't forget to add your pipeline to the ITEM_PIPELINES setting 4 | # See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html 5 | 6 | 7 | # useful for handling different item types with a single interface 8 | from itemadapter import ItemAdapter 9 | 10 | 11 | class LocationsPipeline: 12 | def process_item(self, item, spider): 13 | return item 14 | -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/04_Acting_Human/profiles/profiles/pipelines.py: -------------------------------------------------------------------------------- 1 | # Define your item pipelines here 2 | # 3 | # Don't forget to add your pipeline to the ITEM_PIPELINES setting 4 | # See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html 5 | 6 | 7 | # useful for handling different item types with a single interface 8 | from itemadapter import ItemAdapter 9 | 10 | 11 | class ProfilesPipeline: 12 | def process_item(self, item, spider): 13 | return item 14 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/01.Python Basics/19.1 Exercise Repl.py: -------------------------------------------------------------------------------- 1 | #Guess the output of each print statement before you click RUN! 2 | python = 'I am PYHTON' 3 | 4 | print(python[1:4]) 5 | print(python[1:]) 6 | print(python[:]) 7 | print(python[1:100]) 8 | print(python[-1]) 9 | print(python[-4]) 10 | print(python[:-3]) 11 | print(python[-3:]) 12 | print(python[::-1]) 13 | 14 | """ 15 | am 16 | am PYHTON 17 | I am PYHTON 18 | am PYHTON 19 | N 20 | H 21 | I am PYH 22 | TON 23 | """ -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/PDFs Processing/pdf_processor.py: -------------------------------------------------------------------------------- 1 | import PyPDF2 2 | 3 | with open('./pdfs/dummy.pdf','rb') as file: 4 | reader = PyPDF2.PdfFileReader(file) 5 | print(reader.getNumPages()) 6 | 7 | page = reader.getPage(0) 8 | page.rotateClockwise(90) 9 | 10 | writer = PyPDF2.PdfFileWriter() 11 | writer.addPage(page) 12 | 13 | with open('./pdfs/processed/tilt.pdf','wb') as new_file: 14 | writer.write(new_file) -------------------------------------------------------------------------------- /16.Functional Programming with Python - SW/01.First Class Functions/passing_functions_as_arg_combine_name.py: -------------------------------------------------------------------------------- 1 | def combine_name(func): 2 | return func("John", "Doe") 3 | 4 | 5 | def append_with_space(st1, st2): 6 | return f"{st1} {st2}" 7 | 8 | 9 | def get_government_form_noation(first, last): 10 | return f"{last.upper()}, {first.upper()}" 11 | 12 | 13 | # testing 14 | result = combine_name(append_with_space) 15 | print(result) 16 | 17 | print(combine_name(get_government_form_noation)) 18 | -------------------------------------------------------------------------------- /API HTTP Request/books_api_request.py: -------------------------------------------------------------------------------- 1 | import json 2 | import urllib3 3 | 4 | http = urllib3.PoolManager() 5 | request = http.request('GET','https://booksbyptyadana.herokuapp.com/books') 6 | data = request.data 7 | 8 | print(request.status) 9 | 10 | if len(data) > 0: 11 | book_dict = dict() 12 | books = json.loads(data.decode('utf-8')) 13 | for book in books: 14 | book_dict[book['book_name']]= book['author_name'] 15 | print(book_dict) 16 | else: 17 | print('no data received.') -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/05.Advanced Python Decorators/higher_order_functions.py: -------------------------------------------------------------------------------- 1 | #HOC (Highter Order Functions) 2 | #HOC has 2 types 3 | #1) Functions that accept function as parameter 4 | #2) Functions that return function 5 | 6 | #1) Functions that accept function as parameter 7 | def greet(func): 8 | func() 9 | 10 | #2) Functions that return function 11 | def greet2(): 12 | def new_func(): 13 | print("hello") 14 | return new_func 15 | 16 | 17 | print(greet2()()) -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/exercise96.py: -------------------------------------------------------------------------------- 1 | #create a program that asks the user submit text repeatedly 2 | #The program will exit when user submit CLOSE 3 | #print the output as text file 4 | 5 | with open('./96_file/96_file.txt', 'w') as file: 6 | while True: 7 | user_input = input('Enter anything (to quite- type CLOSE) : '); 8 | if user_input == 'CLOSE': 9 | break; 10 | else: 11 | file.write(user_input + '\n'); -------------------------------------------------------------------------------- /10.Python Code Challenges/Level_01/is_armstrong_number.py: -------------------------------------------------------------------------------- 1 | def is_armstrong_number(num): 2 | original_num = num 3 | total = 0 4 | remainder = num % 10 5 | 6 | while remainder != 0: 7 | total += remainder ** 3 8 | num = num // 10 9 | remainder = num % 10 10 | 11 | return total == original_num 12 | 13 | 14 | 15 | if __name__ == "__main__": 16 | print(is_armstrong_number(371)) 17 | print(is_armstrong_number(123)) 18 | print(is_armstrong_number(153)) -------------------------------------------------------------------------------- /14.Learning Python Generators - JMQ/01.Generator Functions and Expressions/01.Build Generator Function/even_integers_generator.py: -------------------------------------------------------------------------------- 1 | # This is generator function which will return generator object 2 | def even_integers_function(n): 3 | for i in range(n): 4 | if i%2 == 0: 5 | yield i 6 | 7 | 8 | if __name__ == "__main__": 9 | even_gen = even_integers_function(10) 10 | print(even_gen) #generator object got returned. 11 | print(list(even_gen)) #now generator object yeild the results -------------------------------------------------------------------------------- /13.Learning Python Libraries/01.Learning Python Standard Library - KH/01.Python Built In/01_03_CalculatingLength.py: -------------------------------------------------------------------------------- 1 | # Calculating Length 2 | 3 | # len() --> returns length 4 | artist = "Taylor Swift" 5 | print(len(artist)) 6 | 7 | ages = [1,2,3,4,5,6] 8 | print(len(ages)) 9 | 10 | for i in range(len(ages)): 11 | print(ages[i]) 12 | 13 | print(len(["A", "B", "Csdkfjksd"])) 14 | 15 | 16 | candyCollection ={ 17 | "Andy": 1, 18 | "Ellen": 5, 19 | "Jenny": 3 20 | } 21 | 22 | print(len(candyCollection)) -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/01_Basic_WebScraping/ietf_scraper/ietf_scraper/pipelines.py: -------------------------------------------------------------------------------- 1 | # Define your item pipelines here 2 | # 3 | # Don't forget to add your pipeline to the ITEM_PIPELINES setting 4 | # See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html 5 | 6 | 7 | # useful for handling different item types with a single interface 8 | from itemadapter import ItemAdapter 9 | 10 | 11 | class IetfScraperPipeline: 12 | def process_item(self, item, spider): 13 | return item 14 | -------------------------------------------------------------------------------- /Python DB-API/Python - PostgreSQL/forum/forum.sql: -------------------------------------------------------------------------------- 1 | 2 | CREATE TABLE posts ( content TEXT, 3 | time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, 4 | id SERIAL ); 5 | 6 | 7 | /* sample data */ 8 | INSERT INTO posts(id,content,time) 9 | VALUES(1,'amazing post','2016-06-22'), 10 | (2,'ballons are so beautiful','2017-12-04'), 11 | (3,'cats are so cute.','2018-04-08'), 12 | (4,'dogs are just my favourite loyal friend.','2019-01-19'), 13 | (5,'eehhh.. eggs are so delicious','2020-03-15'); -------------------------------------------------------------------------------- /07.Data Structures & Algorithms/Foundation Algorithms - Lynda/05.Searching/search_unordered_list.py: -------------------------------------------------------------------------------- 1 | # searching for an item in an unordered list 2 | # sometimes called a Linear search 3 | 4 | # declare a list of values to operate on 5 | items = [6, 20, 8, 19, 56, 23, 87, 41, 49, 53] 6 | 7 | def find_item(item, itemlist): 8 | for i in range(0, len(itemlist)): 9 | if item == itemlist[i]: 10 | return i 11 | return None 12 | 13 | print(find_item(87, items)) 14 | print(find_item(250, items)) 15 | -------------------------------------------------------------------------------- /16.Functional Programming with Python - SW/03.Advanced Functional Concepts/basic_currying.py: -------------------------------------------------------------------------------- 1 | # similar to partial application, but only with one level deeper 2 | 3 | def curry_add(x): 4 | def curry_add_inner(y): 5 | def curry_add_inner_2(z): 6 | return x + y + z 7 | return curry_add_inner_2 8 | return curry_add_inner 9 | 10 | 11 | add_5 = curry_add(5) 12 | add_5_and_6 = add_5(6) 13 | print(add_5_and_6(7)) 14 | 15 | # or we can even call like below 16 | print(curry_add(5)(6)(7)) 17 | -------------------------------------------------------------------------------- /19.XML and JSON/02.API Documentation with JSON and XML/02_JSON/meeting.json: -------------------------------------------------------------------------------- 1 | { 2 | "meeting" : 3 | { 4 | "time": "2015-09-01 10:00", 5 | "duration": 60, 6 | "description": "2016 Strategic Planning Meeting", 7 | "location": "Building 23, Room 206", 8 | "reminder": 15, 9 | "invitees": [ 10 | "michael@example.com", 11 | "thelma@example.com", 12 | "david@example.com", 13 | "leon@example.com" 14 | ] 15 | } 16 | } -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 01-25/exercise_17.py: -------------------------------------------------------------------------------- 1 | # Question: Calculate the sum of the values of keys a and b . 2 | 3 | d = {"a": 1, "b": 2, "c": 3} 4 | 5 | # Expected output: 6 | # 3 7 | 8 | # Answer 9 | print(d['a'] + d['b']) 10 | 11 | # Explanation: 12 | # It's as easy as that. However, if you want to do the sum of all dictionary values you need to take another approach instead of accessing all values one by one. We're going through that approach later on in another exercise. -------------------------------------------------------------------------------- /16.Functional Programming with Python - SW/01.First Class Functions/divide_safe_checker_with_higher_order_functions.py: -------------------------------------------------------------------------------- 1 | def divide(x, y): 2 | return x/y 3 | 4 | 5 | def divide_by_zero_check(func): 6 | def safe_version(*args): 7 | if args[1] == 0: 8 | print("Warning: second argument is Zero.") 9 | return 10 | return func(*args) 11 | return safe_version 12 | 13 | 14 | divide_safe = divide_by_zero_check(divide) 15 | print(divide_safe(10, 5)) 16 | print(divide_safe(100, 0)) 17 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/01.Python Basics/tuple.py: -------------------------------------------------------------------------------- 1 | # tuple are immutables 2 | my_tuple = (1,2,3,4,5,5,5) 3 | 4 | for item in my_tuple: 5 | print(item) 6 | 7 | print(2 in my_tuple) 8 | print(my_tuple[2]) 9 | 10 | print(my_tuple) 11 | 12 | x,y,*other = my_tuple 13 | sliced_tuple = my_tuple[2:] 14 | print(x) 15 | print(y) 16 | print(other) 17 | print(sliced_tuple) 18 | 19 | #count 20 | print(my_tuple.count(5)) 21 | 22 | #index 23 | print(my_tuple.index(5)) 24 | 25 | #len 26 | print(len(my_tuple)) -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/02.Python Basics II/30.1 Solution Repl.py: -------------------------------------------------------------------------------- 1 | def highest_even(li): 2 | max = 0 3 | for item in li: 4 | if item%2 == 0 and item > max: 5 | max = item 6 | return max 7 | 8 | #version 2 9 | def highest_even2(li): 10 | even_list = [] 11 | for item in li: 12 | if item%2 == 0: 13 | even_list.append(item) 14 | return max(even_list) 15 | 16 | 17 | print(highest_even([10,2,3,4,8,11])) 18 | print(highest_even2([10,2,3,4,8,11])) -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/03_Advanced_Techniques/news_scraper/news_scraper/items.py: -------------------------------------------------------------------------------- 1 | # Define here the models for your scraped items 2 | # 3 | # See documentation in: 4 | # https://docs.scrapy.org/en/latest/topics/items.html 5 | 6 | import scrapy 7 | 8 | 9 | class NewsArticle(scrapy.Item): 10 | url = scrapy.Field() 11 | source = scrapy.Field() 12 | title = scrapy.Field() 13 | description = scrapy.Field() 14 | date = scrapy.Field() 15 | author = scrapy.Field() 16 | text = scrapy.Field() 17 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/01.Python Basics/dictionaries.py: -------------------------------------------------------------------------------- 1 | my_dict = { 2 | "a":"AAA", 3 | "b":"BBB", 4 | "c":"CCC" 5 | } 6 | 7 | print(my_dict["a"]) 8 | 9 | my_dict = { 10 | "a":"AAA", 11 | "b": [1,2,3,4], 12 | "c": True 13 | } 14 | 15 | print(my_dict["b"][1]) 16 | 17 | my_list =[ 18 | { 19 | "a":"AAA", 20 | "b": [1,2,3,4], 21 | "c": True 22 | }, 23 | { 24 | "a":"AAA", 25 | "b": [5,6,7,8], 26 | "c": True 27 | } 28 | ] 29 | 30 | print(my_list[1]['b'][2]) -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/05.Advanced Python Decorators/decorators.py: -------------------------------------------------------------------------------- 1 | #In python, function acts like variables and can assign like that easily 2 | 3 | def morning(): 4 | print("morning") 5 | 6 | say_morning = morning() 7 | print(say_morning) 8 | 9 | print("--------------") 10 | 11 | 12 | say_morning2 = morning 13 | print(say_morning2()) 14 | 15 | print("--------------") 16 | 17 | def hello(func): 18 | func() 19 | 20 | def greet(): 21 | print('greeting everyone!') 22 | 23 | 24 | hello(greet) -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/exercise87.py: -------------------------------------------------------------------------------- 1 | #Add missing items into file 2 | 3 | checklist = ["Portugal", "Germany", "Spain"] 4 | 5 | with open('raw/countries_missing.txt', mode='rt') as file: 6 | countries = file.readlines() 7 | 8 | countries = [c.strip('\n') for c in countries] 9 | 10 | sorted_countries = sorted(countries + checklist) 11 | 12 | with open('processed/countries_sorted.txt', mode='wt') as file: 13 | for c in sorted_countries: 14 | file.writelines(c+'\n') -------------------------------------------------------------------------------- /11.Learning Python - JM/01.Basic/variables.py: -------------------------------------------------------------------------------- 1 | # 2 | # Example file for variables 3 | # 4 | 5 | # Declare a variable and initialize it 6 | x = 100 7 | print(x) 8 | 9 | # # re-declaring the variable works 10 | x = "abc" 11 | print(x) 12 | 13 | # # ERROR: variables of different types cannot be combined 14 | # print("hello" + 123) 15 | print("hello" + str(123)) 16 | 17 | # Global vs. local variables in functions 18 | def some_func(): 19 | # global x 20 | x = 999 21 | print(x) 22 | 23 | 24 | some_func() 25 | print(x) 26 | -------------------------------------------------------------------------------- /13.Learning Python Libraries/01.Learning Python Standard Library - KH/02.Python Math/01_trigonometry_ceiling_floor_constant.py: -------------------------------------------------------------------------------- 1 | # Math Module Part I 2 | import math 3 | 4 | # Constants 5 | print(math.pi) 6 | print(math.e) 7 | 8 | print(math.nan) 9 | print(math.inf) 10 | print(-math.inf) 11 | 12 | # Trigonometry 13 | obst_direction = math.cos(math.pi/4) 14 | print(obst_direction) 15 | print(math.sin(math.pi/4)) 16 | 17 | # Ceiling and Floor 18 | cookies = 10.3 19 | candy = 7 20 | print(math.ceil(cookies)) 21 | print(math.floor(cookies)) -------------------------------------------------------------------------------- /14.Learning Python Generators - JMQ/01.Generator Functions and Expressions/03.Use Generator Object/generator_usage_style.py: -------------------------------------------------------------------------------- 1 | # with loop and generating on the fly 2 | for num in (i for i in range(10)): 3 | print(num) 4 | 5 | 6 | # generting using function 7 | import even_integers_generators 8 | for num in even_integers_generators.even_integers_function(10): 9 | print(num) 10 | 11 | # together with other function 12 | max_num = max(num for num in even_integers_generators.even_integers_function(100)) 13 | print(max_num) -------------------------------------------------------------------------------- /14.Learning Python Generators - JMQ/01.Generator Functions and Expressions/04.Fibonacci Sequence Challenge/fibonacci_generator.py: -------------------------------------------------------------------------------- 1 | def fibonacci_geneator(n): 2 | num1 = 0 3 | num2 = 1 4 | 5 | for i in range(n): 6 | if i == 0: 7 | yield num1 8 | elif i == 1: 9 | yield num2 10 | else: 11 | num1, num2 = num2, num1 + num2 12 | yield num2 13 | 14 | 15 | if __name__ == "__main__": 16 | print(list(fibonacci_geneator(15))) 17 | -------------------------------------------------------------------------------- /16.Functional Programming with Python - SW/02.Python - Functional Parts/mapping.py: -------------------------------------------------------------------------------- 1 | number_list = range(10) 2 | 3 | 4 | # 1) normal way (imperative way) of doubling 5 | doubled_list = [] 6 | for item in number_list: 7 | doubled_list.append(item * 2) 8 | 9 | print(doubled_list) 10 | 11 | 12 | # ------------------------------ 13 | # 2) using map (functional way) 14 | def doubled(x): 15 | return x * 2 16 | 17 | 18 | doubled_list_using_functional = list(map(doubled, number_list)) 19 | print(doubled_list_using_functional) 20 | -------------------------------------------------------------------------------- /01.Complete Python Bootcamp - JP/words.txt: -------------------------------------------------------------------------------- 1 | Alice 2 | was 3 | beginning 4 | to 5 | get 6 | very 7 | tired 8 | of 9 | sitting 10 | by 11 | her 12 | sister 13 | bank 14 | having 15 | nothing 16 | Once 17 | twice 18 | she 19 | had 20 | peeped 21 | into 22 | the 23 | book 24 | her 25 | sister 26 | was 27 | reading 28 | but 29 | it 30 | had 31 | no 32 | pictures 33 | or 34 | conversations 35 | in 36 | it 37 | and 38 | what 39 | is 40 | the 41 | use 42 | of 43 | a 44 | book 45 | thought 46 | Alice 47 | without 48 | pictures 49 | or 50 | conversations -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 51-75/exercise_61.py: -------------------------------------------------------------------------------- 1 | # Question: Create a program that prints out Hello every two seconds. 2 | 3 | # Expected output: 4 | 5 | # ... 6 | # Hello 7 | # Hello 8 | # Hello 9 | # Hello 10 | # Hello 11 | # Hello 12 | # ... 13 | 14 | # Answer: 15 | import time 16 | 17 | while True: 18 | print('Hello') 19 | time.sleep(2) 20 | 21 | # Explanation: 22 | # The sleep method of the built-in time module suspends the execution of the script for the given number of seconds. -------------------------------------------------------------------------------- /10.Python Code Challenges/Level_01/02_is_prime.py: -------------------------------------------------------------------------------- 1 | """ 2 | Input: Integer 3 | Output: True for prime, False for not prime 4 | """ 5 | 6 | def is_prime(num): 7 | prime = False 8 | if num > 1: 9 | for i in range(2, num): 10 | if num % i == 0: 11 | break 12 | else: 13 | prime = True 14 | return prime 15 | 16 | if __name__ == "__main__": 17 | number = int(input("Enter a number: ")) 18 | print("It is a prime number." if is_prime(number) else "It is NOT a prime number.") -------------------------------------------------------------------------------- /15.Python Decorators - JM/01.Functions/fibonacci_three.py: -------------------------------------------------------------------------------- 1 | def fibonacci_three(a, b, c): 2 | '''Accepts as 3 input fibonacci numbers''' 3 | def get_three(): 4 | '''returns 3 fibonacci numbers''' 5 | return a, b, c 6 | return get_three 7 | 8 | 9 | if __name__ == "__main__": 10 | print(fibonacci_three(1, 2, 3)) 11 | 12 | f = fibonacci_three(1, 2, 3) 13 | print(f) 14 | # as f is assigned with the function returned, it can act as function again and will return those tuples. 15 | print(f()) 16 | -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 01-25/exercise_05.py: -------------------------------------------------------------------------------- 1 | # Question: Complete the script so that it prints out the second item of the list. 2 | 3 | letters = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"] 4 | # Expected output: 5 | # b 6 | 7 | # Answer: 8 | print(letters[1]) 9 | 10 | # Explanation: 11 | # Every item of a list is referenced to an index number starting from zero and increasing by one. Such a hidden index system is used to access list items. Therefore,we accessed item b using an index of 1. -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 01-25/exercise_24.py: -------------------------------------------------------------------------------- 1 | # Question: Please complete the script so that it prints out the expected output. 2 | 3 | d = dict(a = list(range(1, 11)), b = list(range(11, 21)), c = list(range(21, 31))) 4 | 5 | 6 | # Expected output: 7 | # b has value [11, 12, 13, 14, 15, 16, 17, 18, 19, 20] 8 | # c has value [21, 22, 23, 24, 25, 26, 27, 28, 29, 30] 9 | # a has value [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] 10 | 11 | # Answer 12 | for k in d.keys(): 13 | print(f'{k} has value {d[k]}') -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/01.Python Basics/27.1 Exercise Repl.py: -------------------------------------------------------------------------------- 1 | #What is the output of this code? 2 | #Before you clikc RUN, guess the output of each print statement! 3 | new_list = ['a', 'b', 'c'] 4 | print(new_list[1]) 5 | print(new_list[-2]) 6 | print(new_list[1:3]) 7 | new_list[0] = 'z' 8 | print(new_list) 9 | 10 | my_list = [1,2,3] 11 | bonus = my_list + [5] 12 | my_list[0] = 'z' 13 | print(my_list) 14 | print(bonus) 15 | 16 | # b 17 | # b 18 | # ['b', 'c'] 19 | # ['z', 'b', 'c'] 20 | # ['z', 2, 3] 21 | # [1, 2, 3, 5] -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/16.Automation Testing/automation.py: -------------------------------------------------------------------------------- 1 | from selenium import webdriver 2 | 3 | chrome_browser = webdriver.Chrome('./chromedriver') 4 | 5 | chrome_browser.maximize_window() 6 | chrome_browser.get('https://www.seleniumeasy.com/test/basic-first-form-demo.html') 7 | 8 | print('Selenium Easy Demo - Simple Form to Automate using Selenium' in chrome_browser.title) 9 | 10 | #auto click on button 11 | button = chrome_browser.find_element_by_class_name('btn-default') 12 | print(button.get_attribute('innerHTML')) -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 01-25/exercise_19.py: -------------------------------------------------------------------------------- 1 | # Question: Add a new pair of key (e.g. c ) and value (e.g. 3 ) to the dictionary and print out the new dictionary. 2 | 3 | d = {"a": 1, "b": 2} 4 | 5 | # Expected output: 6 | # {'a': 1, 'c': 3, 'b': 2} 7 | 8 | #Answer 9 | d['c']=3 10 | print(d) 11 | 12 | # Explanation: 13 | # Adding pairs of keys and values is straightforward as you can see. Note though that you cannot fix the order of the dictionary items. Dictionaries are unordered collections of items. -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/exercise_26.py: -------------------------------------------------------------------------------- 1 | # Question: Make a script that prints out numbers from 1 to 10 2 | 3 | # Expected output: 4 | 5 | # 1 6 | # 2 7 | # 3 8 | # 4 9 | # 5 10 | # 6 11 | # 7 12 | # 8 13 | # 9 14 | # 10 15 | 16 | # Answer: 17 | for item in range(1,11): 18 | print(item) 19 | 20 | # Explanation: 21 | # A for loop is used to repeat an action (i.e. print ) until the iterating sequence (i.e. range ) is consumed. In our case it would print all items of the range one by one. 22 | -------------------------------------------------------------------------------- /07.Data Structures & Algorithms/Foundation Algorithms - Lynda/02.Data Structures/queue_with_deque.py: -------------------------------------------------------------------------------- 1 | # try out the Python queue functions 2 | from collections import deque 3 | 4 | # create a new empty deque object that will function as a queue 5 | queue = deque() 6 | 7 | # add some items to the queue 8 | queue.append(1) 9 | queue.append(2) 10 | queue.append(3) 11 | queue.append(4) 12 | 13 | # print the queue contents 14 | print(queue) 15 | 16 | # pop an item off the front of the queue 17 | item = queue.popleft() 18 | print(item) 19 | print(queue) -------------------------------------------------------------------------------- /16.Functional Programming with Python - SW/02.Python - Functional Parts/filtering.py: -------------------------------------------------------------------------------- 1 | number_list = range(10) 2 | 3 | # 1) Imperative Way 4 | # we can also use list comprehension if we want here. 5 | even_numbers = [] 6 | for item in number_list: 7 | if item % 2 == 0: 8 | even_numbers.append(item) 9 | 10 | print(even_numbers) 11 | 12 | 13 | # 2) Functional Way 14 | def is_even(x): 15 | return x % 2 == 0 16 | 17 | 18 | even_numbers_using_functional = list(filter(is_even, number_list)) 19 | print(even_numbers_using_functional) 20 | -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/03_Advanced_Techniques/news_scraper_challenge/news_scraper_challenge/items.py: -------------------------------------------------------------------------------- 1 | # Define here the models for your scraped items 2 | # 3 | # See documentation in: 4 | # https://docs.scrapy.org/en/latest/topics/items.html 5 | 6 | import scrapy 7 | 8 | 9 | class NewsArticle(scrapy.Item): 10 | url = scrapy.Field() 11 | source = scrapy.Field() 12 | title = scrapy.Field() 13 | description = scrapy.Field() 14 | date = scrapy.Field() 15 | author = scrapy.Field() 16 | text = scrapy.Field() 17 | -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/05.Advanced Python Decorators/decorator4.py: -------------------------------------------------------------------------------- 1 | #decorator of checking how long a certain function took in seconds 2 | from time import time 3 | 4 | def performance(func): 5 | def wrapper(*args, **kwargs): 6 | t1 = time() 7 | result = func(*args, **kwargs) 8 | t2 = time() 9 | print(f'took {t2-t1} seconds') 10 | return result 11 | return wrapper 12 | 13 | @performance 14 | def long_time(): 15 | for i in range(0,1000000): 16 | i*5 17 | 18 | long_time() -------------------------------------------------------------------------------- /API HTTP Request/sample_api_request.py: -------------------------------------------------------------------------------- 1 | import json 2 | from urllib.request import urlopen 3 | 4 | with urlopen("http://dummy.restapiexample.com/api/v1/employees") as response: 5 | source = response.read() 6 | 7 | data = json.loads(source) 8 | 9 | # print(json.dumps(data,indent=2)) 10 | 11 | #len of the data 12 | # print(len(data['data'])) 13 | 14 | employee = dict() 15 | 16 | for item in data["data"]: 17 | name = item["employee_name"] 18 | salary = item["employee_salary"] 19 | 20 | employee[name] = salary 21 | 22 | print(employee) -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 01-25/exercise_06.py: -------------------------------------------------------------------------------- 1 | # Question: Please complete the script so that it prints out a list slice containing items d , e , and f . 2 | 3 | letters = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"] 4 | # Expected output: 5 | # ['d', 'e', 'f'] 6 | 7 | 8 | # Answer: 9 | print(letters[3:6]) 10 | 11 | # Explanation: 12 | # d has an index of 3 here, e has an index of 4 , and f has an index of 5, but since the slicing syntax is upper-bound exclusive, we need to pass 6 as the upper bound. -------------------------------------------------------------------------------- /14.Learning Python Generators - JMQ/01.Generator Functions and Expressions/02.Generator Expression/04_reverse_uppercase_generator_expression.py: -------------------------------------------------------------------------------- 1 | names_list = ["John", "Suzzie", "Kala", "Liz", "Rob", "Debby"] 2 | 3 | reverse_uppercase_names = (name.upper()[::-1] for name in names_list) 4 | print(list(reverse_uppercase_names)) 5 | 6 | # Or can even break into two parts 7 | # generator can support this 8 | upper_case = (name.upper() for name in names_list) 9 | reverse_uppercase_names = (name[::-1] for name in upper_case) 10 | print(list(reverse_uppercase_names)) -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/02.Python Basics II/parameters arguments default keywords.py: -------------------------------------------------------------------------------- 1 | #parameters 2 | # def hello(name, emoji): 3 | # print(f"hello {name} {emoji}") 4 | 5 | #keyword parameters 6 | def hello(name="Luke Skywalker", emoji="<3"): 7 | print(f"hello {name} {emoji}") 8 | 9 | #arguments 10 | #positional arguments 11 | #follow the correct orders 12 | hello("Richard", ":)") 13 | hello("Vivian", ":D") 14 | 15 | #keywords arguments 16 | #not best pratice 17 | hello(emoji=":P", name="Kid") 18 | 19 | hello() 20 | hello("Babe") -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/03.Advanced Python Object Oriented Programming/OOP_skeleton.py: -------------------------------------------------------------------------------- 1 | class NameOfClass(): 2 | class_attribute = 'value' 3 | 4 | def __init__(self, param1, param2): 5 | self.param1 = param1 6 | self.param2 = param2 7 | 8 | def method(self): 9 | #code 10 | pass 11 | 12 | @classmethod 13 | def cls_method(cls, param1, param2): 14 | #code 15 | pass 16 | 17 | @staticmethod 18 | def stc_method(param1, param2): 19 | #code 20 | pass -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 01-25/exercise_20.py: -------------------------------------------------------------------------------- 1 | # Question: Calculate the sum of all dictionary values. 2 | 3 | d = {"a": 1, "b": 2, "c": 3} 4 | 5 | # Expected output: 6 | # 6 7 | 8 | #Answer: 9 | my_sum=0 10 | for value in d.values(): 11 | my_sum+=value 12 | print(my_sum) 13 | 14 | #Answer 2: 15 | d = {"a": 1, "b": 2, "c": 3} 16 | print(sum(d.values())) 17 | 18 | 19 | # Explanation: 20 | # d.values() returns a list-like dict_values object while the sum function calculates the sum of the dict_values items. -------------------------------------------------------------------------------- /16.Functional Programming with Python - SW/01.First Class Functions/closure_basic_counter.py: -------------------------------------------------------------------------------- 1 | def create_counter(): 2 | count = 0 3 | 4 | def get_count(): 5 | return f"Current Count: {count}" 6 | 7 | def increment(): 8 | nonlocal count 9 | count += 1 10 | 11 | return (get_count, increment) 12 | 13 | 14 | # Closure Usage 15 | get_count, increment = create_counter() 16 | print(get_count()) 17 | increment() 18 | increment() 19 | print(get_count()) 20 | increment() 21 | increment() 22 | increment() 23 | print(get_count()) 24 | -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 51-75/exercise_58.py: -------------------------------------------------------------------------------- 1 | # Question: Please download the json file in the attachment and use Python to add a new employee to the content of the file so that the file looks like in the expected output below. 2 | 3 | # Expected output: json file added employees_58.png 4 | 5 | # Answer: 6 | import json 7 | with open('./output/output_56.json','r') as file: 8 | content_dict = json.loads(file.read()) 9 | 10 | content_dict['employees'].append(dict(firstname='Albert',lastname='Bert')) 11 | print(content_dict) -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 01-25/exercise_08.py: -------------------------------------------------------------------------------- 1 | # Question: Complete the script so that it prints out letter i using negative indexing. 2 | 3 | letters = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"] 4 | 5 | # Expected output: 6 | # i 7 | 8 | 9 | # Answer: 10 | print(letters[-2]) 11 | 12 | 13 | # Explanation: 14 | # Besides the left-to-right positive indexing system that starts from zero, sequence data types such as lists also have a second indexing system that starts from -1 and decreases by one from right to left. -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 01-25/exercise_11.py: -------------------------------------------------------------------------------- 1 | # Exercise for reference: 2 | 3 | # Create a script that generates and prints a list of numbers from 1 to 20. Please do not create the list manually. 4 | 5 | # Answer: 6 | my_list = range(1,21) 7 | print(list(my_list)) 8 | 9 | 10 | # Explanation: 11 | # range() is a Python built-in function that generates a range of integers. However, range() creates a Python range object. To get a real list object you need to use the list() function to convert the range object into a list object. -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 01-25/exercise_25.py: -------------------------------------------------------------------------------- 1 | # Exercise for reference: 2 | 3 | # Make a script that prints out letters of English alphabet from a to z, one letter per line in the terminal. 4 | 5 | # Answer 6 | import string 7 | 8 | for letter in string.ascii_lowercase: 9 | print(letter) 10 | 11 | 12 | # Explanation: 13 | # string is a built-in module and string.ascii_lowercase returns a string object containing all 26 letters of English alphabet. Then we simply iterate through that string and print out the string items. -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 51-75/exercise_62.py: -------------------------------------------------------------------------------- 1 | # Question: Create a program that once executed the program prints Hello instantly first, 2 | # then it prints it after 1 second, then after 2, 3, 4, and so on the interval increases between prints. 3 | 4 | # Expected output: 5 | 6 | # ... 7 | # Hello 8 | # Hello 9 | # Hello 10 | # Hello 11 | # Hello 12 | # Hello 13 | # ... 14 | 15 | # Answer: 16 | import time 17 | 18 | second = 0 19 | while True: 20 | print('Hello') 21 | second += 1 22 | time.sleep(second) 23 | -------------------------------------------------------------------------------- /13.Learning Python Libraries/01.Learning Python Standard Library - KH/02.Python Math/02_factorial_sqaure_GCD.py: -------------------------------------------------------------------------------- 1 | # Math Module Part 2 2 | import math 3 | 4 | # Factorial & Square Root 5 | print(math.factorial(3)) 6 | print(math.sqrt(64)) 7 | 8 | # Greatest Common Denominator GCD 9 | print(math.gcd(52, 8)) 10 | print(math.gcd(8, 52)) 11 | 12 | # Degrees and Radians 13 | print(math.radians(360)) # how many radians are in 360 degrees 14 | print(math.pi * 2) # as 2pi is same as 360 dregree 15 | 16 | # reversely, we can get degree from radians 17 | print(math.degrees(math.pi * 2)) -------------------------------------------------------------------------------- /19.XML and JSON/02.API Documentation with JSON and XML/02_JSON/menu.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "header": "File", 4 | "items": [ 5 | {"id": "Open", "label": "Open"}, 6 | {"id": "New", "label": "New"}, 7 | {"id": "Close", "label": "Close"} 8 | ] 9 | }, 10 | { 11 | "header": "View", 12 | "items": [ 13 | {"id": "ZoomIn", "label": "Zoom In"}, 14 | {"id": "ZoomOut", "label": "Zoom Out"}, 15 | {"id": "OriginalView", "label": "Original View"} 16 | ] 17 | } 18 | ] -------------------------------------------------------------------------------- /09.Automate the Boring Stuffs with Python Projects - AS/Chapter 3 – Functions/collatz_sequence.py: -------------------------------------------------------------------------------- 1 | def collatz(number): 2 | if number % 2 == 0: 3 | return number // 2 4 | else: 5 | return 3 * number + 1 6 | 7 | def main(): 8 | try: 9 | number = int(input("Enter number:\n")) 10 | while number != 1: 11 | number = collatz(number) 12 | print(number) 13 | 14 | except Exception: 15 | print("You didn't provide the valid number!") 16 | 17 | if __name__ == "__main__": 18 | main() -------------------------------------------------------------------------------- /17.Python for Automation/01.Automate File Folder Terminal/01.file_automation.py: -------------------------------------------------------------------------------- 1 | # read file and filter out only pass students 2 | with open('../00.data/inputFile.txt', 'r') as file: 3 | 4 | # write the pass/fail lists 5 | pass_file = open("../00.data/pass_list.txt", "w") 6 | fail_file = open("../00.data/fail_list.txt", "w") 7 | 8 | for line in file: 9 | if line.split(" ")[2].strip("\n") == "P": 10 | pass_file.write(line) 11 | else: 12 | fail_file.write(line) 13 | 14 | pass_file.close() 15 | fail_file.close() 16 | -------------------------------------------------------------------------------- /17.Python for Automation/04.Automating with APIs/01.calling_APIs.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import json 3 | 4 | 5 | base_url = "https://api.upcitemdb.com/prod/trial/lookup" 6 | parameters = {"upc": "883929609673"} 7 | 8 | response = requests.get(base_url, params=parameters) 9 | 10 | info = json.loads(response.content) 11 | # print(type(info)) 12 | # print(info) 13 | # print(json.dumps(info, indent=1)) 14 | 15 | items = info["items"] 16 | item_info = items[0] 17 | item_title = item_info["title"] 18 | item_brand = item_info["brand"] 19 | print(item_title, " by ", item_brand) 20 | -------------------------------------------------------------------------------- /00.Python Mini Projects/08.Baby Conversation Simulator/baby.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | print('***** Welcome to Baby Conversation Simulator *****') 4 | 5 | questions = { 6 | '1': 'Why is the sky blue?', 7 | '2': 'What does God look like?', 8 | '3': 'Where do you go when you die?', 9 | '4': 'Why is water wet?', 10 | '5': 'Where do babies come from?', 11 | } 12 | 13 | number = random.randint(1,5) 14 | 15 | answer = input(f'\n{questions[str(number)]} : ') 16 | while answer != 'just because': 17 | answer = input('Why?').strip().lower() 18 | 19 | print('oh... ok') -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/01.Python Basics/18.1 Exercise Repl.py: -------------------------------------------------------------------------------- 1 | # 1 What would be the output of the below 4 print statements? 2 | #Try to answer these before you click RUN! 3 | 4 | print("Hello {}, your balance is {}.".format("Cindy", 50)) 5 | 6 | print("Hello {0}, your balance is {1}.".format("Cindy", 50)) 7 | 8 | print("Hello {name}, your balance is {amount}.".format(name="Cindy", amount=50)) 9 | 10 | print("Hello {0}, your balance is {amount}.".format("Cindy", amount=50)) 11 | 12 | # 2 How would you write this using f-string? (Scroll down for answer) -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/exercise_48.py: -------------------------------------------------------------------------------- 1 | # Question: The script is supposed to print out letter "e" if the letter is in string "Hello", but it doesn't. Please try to fix the script. 2 | 3 | # for letter in "Hello": 4 | # if letter == "e": 5 | # print(letter) 6 | # Expected output: 7 | 8 | # e 9 | 10 | # Answer: 11 | for letter in "Hello": 12 | if letter == "e": 13 | print(letter) 14 | 15 | # Explanation: 16 | # Solution was to indent the print statement because you always indent the line under an if statement. -------------------------------------------------------------------------------- /05.More Python - Microsoft/06.managing_file_directories.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | 3 | # Get current directory 4 | cwd = Path.cwd() 5 | 6 | # Get the Parent Directory 7 | parent = cwd.parent 8 | 9 | #Is it a directory? 10 | is_directory = Path.is_dir(parent) 11 | print(f'\nIs it a directory?\n{is_directory}') 12 | 13 | #Is it a file? 14 | is_file = Path.is_file(parent) 15 | print(f'\nIs it a file?\n{is_file}') 16 | 17 | #List child directories 18 | print(f'\n--- directory content ---\n') 19 | for child in parent.iterdir(): 20 | if child.is_dir(): 21 | print(child) -------------------------------------------------------------------------------- /07.Data Structures & Algorithms/Foundation Algorithms - Lynda/03.Recursion/Fibonacci_series_with_loop.py: -------------------------------------------------------------------------------- 1 | def get_fibonacci_series(total_num): 2 | num1 = 0 3 | num2 = 1 4 | fib_list = [num1] 5 | 6 | for i in range(total_num - 1): 7 | 8 | total = num1 + num2 9 | num2 = num1 10 | num1 = total 11 | fib_list.append(total) 12 | 13 | return fib_list 14 | 15 | if __name__ == "__main__": 16 | how_many = int(input("How many fibonacci numbers? ")) 17 | print(get_fibonacci_series(how_many)) 18 | 19 | -------------------------------------------------------------------------------- /01.Complete Python Bootcamp - JP/flowers.txt: -------------------------------------------------------------------------------- 1 | A: African Daisy 2 | B: Bellflower 3 | C: Coral Bells 4 | D: Desert Rose 5 | E: English Bluebell 6 | F: Forget Me Not 7 | G: Goldenrod 8 | H: Heliotrope 9 | I: Impatiens 10 | J: Jamesia americana 11 | K: Kangaroo Paw 12 | L: Lily of the Valley 13 | M: Monks Hood 14 | N: Nemophila 15 | O: Ox Eye Daisy 16 | P: Peace Lily 17 | Q: Quaker Ladies 18 | R: Rain Lily 19 | S: Snapdragon 20 | T: Trumpet Vine 21 | U: Urn Plant 22 | V: Viola wittrockiana 23 | W: Whirling Butterflies 24 | X: Xanthoceras sorbifolium 25 | Y: Yellow Archangel 26 | Z: Zinnia elegans -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/exercise_39.py: -------------------------------------------------------------------------------- 1 | # Question: The script is supposed to output the cosine of angle 1 radian, but instead it is throwing an error. Please fix the code so that it prints out the expected output. 2 | 3 | # import math 4 | # print(math.cosine(1)) 5 | 6 | # Expected output: 7 | # 0.5403023058681397 8 | 9 | 10 | # Answer: 11 | import math 12 | print(math.cos(1)) 13 | print(dir(math)) 14 | 15 | # Hint: You could get a list of all available methods of the math module with dir(math) and see whether cosine is there or not. -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/exercise_46.py: -------------------------------------------------------------------------------- 1 | #Write a script that extracts letters from the 26 text files 2 | #and put the letters in a list 3 | 4 | # Hint: Use glob.glob to create a list of file paths and then iterate through 5 | # that list reading the content of each file. 6 | 7 | #Answer: 8 | import glob 9 | 10 | file_list = glob.glob('output_45/[a-z].txt') 11 | letter_list = [] 12 | 13 | for filename in file_list: 14 | with open(filename,'r')as file: 15 | letter_list.append(file.read()) 16 | 17 | print(letter_list) 18 | -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/exercise92.py: -------------------------------------------------------------------------------- 1 | # download the attached ZIP file and extract its files in a folder. 2 | # Then, write a script that counts and prints out the number of .py files in that folder. 3 | import pathlib 4 | 5 | count = 0; 6 | for path in pathlib.Path('./92_files').iterdir(): 7 | if path.is_file() and path.suffix == '.py': 8 | count += 1; 9 | 10 | print(f'Number of files {count}'); 11 | 12 | #alternative way 13 | # import glob 14 | 15 | # file_list=glob.glob1("files","*.py") 16 | # print(len(file_list)) 17 | -------------------------------------------------------------------------------- /07.Data Structures & Algorithms/Data Structure & Algorithms - Udacity/course_excitement.py: -------------------------------------------------------------------------------- 1 | # Write a function called "show_excitement" where the string 2 | # "I am super excited for this course!" is returned exactly 3 | # 5 times, where each sentence is separated by a single space. 4 | # Return the string with "return". 5 | # You can only have the string once in your code. 6 | # Don't just copy/paste it 5 times into a single variable! 7 | 8 | 9 | def show_excitement(): 10 | return " ".join("I am super excited for this course!" for item in range(5)) 11 | 12 | print(show_excitement()) -------------------------------------------------------------------------------- /09.Automate the Boring Stuffs with Python Projects - AS/Chapter 5 – Dictionaries and Structuring Data/character_counter.py: -------------------------------------------------------------------------------- 1 | import pprint 2 | 3 | message = "Today is quite cloudy in Yangon. I just watched #Alive korean zombie moive which is pretty good." 4 | 5 | count = {} 6 | 7 | for character in message.upper(): 8 | count.setdefault(character, 0) #if key doesn't exist in dict, set 0 as default value 9 | count[character] = count[character] + 1 10 | 11 | #pprint.pprint(count) 12 | text = pprint.pformat(count) #if we want the output string to do further manipulation 13 | print(text) -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/07.Advanced Python Generators/custom_range_generator.py: -------------------------------------------------------------------------------- 1 | class MyGen(): 2 | current = 0 3 | 4 | def __init__(self, first, last): 5 | self.first = first 6 | self.last = last 7 | 8 | def __iter__(self): 9 | return self 10 | 11 | def __next__(self): 12 | if MyGen.current < self.last: 13 | num = MyGen.current 14 | MyGen.current += 1 15 | return num 16 | raise StopIteration 17 | 18 | 19 | gen = MyGen(0,100) 20 | for i in gen: 21 | print(i) 22 | -------------------------------------------------------------------------------- /13.Learning Python Libraries/01.Learning Python Standard Library - KH/01.Python Built In/01_08_TypeFunctions.py: -------------------------------------------------------------------------------- 1 | r = range(0, 30) 2 | print(type(r)) 3 | print(type(10)) 4 | print(type("A")) 5 | print(type("DKKSDL")) 6 | 7 | 8 | class Car: 9 | pass 10 | 11 | class Truck(Car): 12 | pass 13 | 14 | c = Car() 15 | convert = Car() 16 | t = Truck() 17 | print(type(c)) 18 | print(type(t)) 19 | 20 | print(type(c) == type(t)) 21 | print(type(c) == type(convert)) 22 | 23 | print(isinstance(c, Car)) 24 | print(isinstance(t, Truck)) 25 | 26 | 27 | if isinstance(r, range): 28 | print(list(r)) -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 01-25/exercise_01.py: -------------------------------------------------------------------------------- 1 | #Question: Let's start with easy things first. What will the following code produce? 2 | 3 | a = 2 4 | a = 4 5 | a = 6 6 | print(a + a + a) 7 | 8 | 9 | 10 | # Answer: 11 | # 18 12 | 13 | # Explanation: 14 | # The script would output 18 in the command line. Below is the explanation. 15 | # Since Python reads and executes scripts from top to bottom, variable a will be updated in every line until line 3 where a finally gets the value of 6 . Then the print function prints out 6 + 6 + 6 which is 18 . -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 01-25/exercise_09.py: -------------------------------------------------------------------------------- 1 | # Question: Complete the script so that it prints out a list slice containing the last three items of list letters . 2 | 3 | letters = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"] 4 | 5 | # Expected output: 6 | # ['h', 'i', 'j'] 7 | 8 | # Answer: 9 | print(letters[-3:]) 10 | 11 | # Explanation: 12 | # [-3:] means from item with index -3 (i.e. h ) to the very last item of the list. When you don't put any index to the right of the colon everything is included and upper-bound exclusivity is ignored. -------------------------------------------------------------------------------- /03.Complete Python Developer - Zero to Mastery - AN/13.Scripting with Python/PDFs Processing/pdf_dynamic_merger.py: -------------------------------------------------------------------------------- 1 | import PyPDF2 2 | import sys 3 | 4 | inputs = sys.argv[1:] 5 | 6 | def pdf_combiner(pdf_list): 7 | merger = PyPDF2.PdfFileMerger() 8 | for pdf in pdf_list: 9 | print(pdf) 10 | merger.append(pdf) 11 | merger.write('./pdfs/processed/super.pdf') 12 | 13 | if __name__ == "__main__": 14 | pdf_combiner(inputs) 15 | 16 | #how to run 17 | #python pdf_dynamic_merger ..etc 18 | #python pdf_dynamic_merger.py pdfs/dummy.pdf pdfs/twopage.pdf 19 | -------------------------------------------------------------------------------- /11.Learning Python - JM/01.Basic/conditionals.py: -------------------------------------------------------------------------------- 1 | # 2 | # Example file for working with conditional statements 3 | # 4 | 5 | def main(): 6 | x, y = 10, 100 7 | 8 | # conditional flow uses if, elif, else 9 | if x < y: 10 | print("x is smaller than y") 11 | elif x == y: 12 | print("x has same value as y") 13 | else: 14 | print("x is larger than y") 15 | 16 | 17 | # conditional statements let you use "a if C else b" 18 | result = "x is less than y" if x < y else "x is same as or larger than y" 19 | print(result) 20 | 21 | 22 | if __name__ == "__main__": 23 | main() 24 | -------------------------------------------------------------------------------- /18.Web Scraping with Python Scrapy - RM/03_Advanced_Techniques/news_scraper_challenge/news_scraper_challenge/pipelines.py: -------------------------------------------------------------------------------- 1 | # Define your item pipelines here 2 | # 3 | # Don't forget to add your pipeline to the ITEM_PIPELINES setting 4 | # See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html 5 | 6 | 7 | # useful for handling different item types with a single interface 8 | from itemadapter import ItemAdapter 9 | 10 | 11 | class NewsScraperChallengePipeline: 12 | def process_item(self, item, spider): 13 | item.author = item.author.replace(', CNN', '') 14 | return item 15 | -------------------------------------------------------------------------------- /02.Modern Python 3 Bootcamp - CS/13.Lists Comprehensions/exercise.py: -------------------------------------------------------------------------------- 1 | """ 2 | To generate the following using a nested list comprehension: 3 | 4 | [ 5 | [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 6 | [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 7 | [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 8 | [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 9 | [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 10 | [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 11 | [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 12 | [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 13 | [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 14 | [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] 15 | ] 16 | """ 17 | 18 | lst = [[x for x in range(10)] for item in range(10)] 19 | print(lst) -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 26-50/exercise_28.py: -------------------------------------------------------------------------------- 1 | # Question: Why is there an error in the code and how would you fix it? 2 | 3 | # def foo(a, b): 4 | # print(a + b) 5 | 6 | # x = foo(2, 3) * 10 7 | 8 | 9 | # Answer: 10 | 11 | def foo(a, b): 12 | return (a + b) 13 | 14 | x = foo(2, 3) * 10 15 | print(x) 16 | 17 | # Line 4 throws a TypeError because Python cannot multiply a None type object with an integer. The function output is what produces a None object because the function definition is not returning anything. Fix it by using return instead of print : -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 51-75/exercise_51.py: -------------------------------------------------------------------------------- 1 | # Question: The code produces an error. Please understand the error and try to fix it 2 | 3 | # print(type("Hey".replace("ey","i")[-1]) 4 | 5 | # Answer: 6 | print(type("Hey".replace("ey","i")[-1])) 7 | 8 | # Explanation: 9 | # This code produces a SyntaxError: unexpected EOF while parsing which means that Python found an unexpected End Of File while parsing. The reason of an unexpected end of file is there's a missing closing bracket at the end of the script. So, adding a closing bracket at the end of the file fixes the code. -------------------------------------------------------------------------------- /04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/exercise90.py: -------------------------------------------------------------------------------- 1 | #from database.db, print out those countries with an area of greater than 2,000, 000. 2 | #export results as csv 3 | 4 | import sqlite3 5 | import pandas as pd 6 | 7 | conn = sqlite3.connect('database/database.db') 8 | c = conn.cursor(); 9 | 10 | c.execute('SELECT * FROM countries WHERE area >= 2000000;') 11 | results = c.fetchall(); 12 | conn.close(); 13 | 14 | df = pd.DataFrame.from_records(results); 15 | df.columns = ['Rank', 'Country', 'Area', 'Population']; 16 | df.to_csv('database/countries_with_big_area.csv'); -------------------------------------------------------------------------------- /11.Learning Python - JM/enumerate.py: -------------------------------------------------------------------------------- 1 | names = ['Jerry', 'Kramer', 'Elaine', 'George', 'Newman'] 2 | 3 | # Rewrite the for loop to use enumerate 4 | indexed_names = [] 5 | for i,name in enumerate(names): 6 | index_name = (i,name) 7 | indexed_names.append(index_name[1]) 8 | print(indexed_names) 9 | 10 | # Rewrite the above for loop using list comprehension 11 | indexed_names_comp = [(i,name) for i,name in enumerate(names)] 12 | print(indexed_names_comp) 13 | 14 | # Unpack an enumerate object with a starting index of one 15 | indexed_names_unpack = [*enumerate(names, start=1)] 16 | print(indexed_names_unpack) -------------------------------------------------------------------------------- /16.Functional Programming with Python - SW/02.Python - Functional Parts/reducing.py: -------------------------------------------------------------------------------- 1 | from functools import reduce 2 | 3 | numbers_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] 4 | 5 | # acc is accumulator which is current value, x is current element 6 | 7 | 8 | def get_sum(acc, x): 9 | print(f"Accumulator is {acc}, x is {x}") 10 | return acc + x 11 | 12 | 13 | # Reduce squashed down the input elements into single value output 14 | sum = reduce(get_sum, numbers_list) 15 | print(sum) 16 | 17 | # We can also pass initial value as 3rd argument 18 | total = reduce(get_sum, numbers_list, 1000) 19 | print(total) 20 | --------------------------------------------------------------------------------