Archives : June-2019

< Section 15 | Section 17 > Advanced Numbers https://www.udemy.com/complete-python-bootcamp/learn/lecture/3650896?start=0#questions Hexadecimal hex() Values are returned as strings hex(246) 0xf6 hex(256) 0x200 Binary bin() Values are returned as strings bin(1234) 0b10011010010 pow() Looks like PHP to me… 2**3 == pow(2,3) abs() abs(-4) 4 round() Rounds to 0 places by default round(4.75,1) 4.8 round(4.75) 5 Advanced Strings ..

Read more

< Section 14 | Section 16 > Collections Module https://www.udemy.com/complete-python-bootcamp/learn/lecture/3512826?start=0#questions The collections module is a built in module that implements specialized container datatypes providing alternatives to python’s general purpose build-in containers.  We’ve already discussed several of the basics: dict, list, set and tuple Counter Counter counts the number of time an item appears in a ..

Read more

< Section 12 | Section 14 Generators with Python https://www.udemy.com/complete-python-bootcamp/learn/lecture/9523120#questions Generator functions all us to write a function that can send back a value and then later resume to pick up where it left off. These allow us to generate a sequence of values over time. The main difference in syntax will be the user ..

Read more

< Section 11 | Section 12 > Decorators with Python Overview https://www.udemy.com/complete-python-bootcamp/learn/lecture/9497658#questions There is A LOT going on here, so pay attention to the steps in order! Decorators Decorators allow you to ‘decorate’ or ‘wrap’ a function with additional code. def simple_func(): # do some stuff return something Later you might want to add some ..

Read more

< Section 10 | Section 12 > Overview – Blackjack https://www.udemy.com/complete-python-bootcamp/learn/lecture/9497646#questions Instructions Use OOP to create a BlackJack game with Python Computer dealer, human player Normal deck of cards Human: bank amount Dealer 1 up, 1 down Human 2 up Human goes first Hit or stay No splits, Insurance or Double Down Plays until done ..

Read more

< Section 9 | Section 11 Errors and Exception Handling https://www.udemy.com/complete-python-bootcamp/learn/lecture/9478394#questions Errors are bound to happen – especially when someone else uses it in an unexpected way Error handling is used in an attempt to plan for these errors Example: Someone tries to write to a file only opened mode=’r’ Without error handling, the entire ..

Read more

Section 9 Menu < Section 8 | Section 10 > Pip Install and PyPi Modules and Packages __name__ and “__main__” Pip Install and PyPi https://www.udemy.com/complete-python-bootcamp/learn/lecture/9497628#questions Pypi is a repository for open-sourced third party Python packages. It is similar to RubyGems in the Ruby world, PHP’s Packagist, CPAN for Perl and NPM for Node.js So far, ..

Read more

Section 8 Menu < Section 7 | Section 9 > Introduction Introduction https://www.udemy.com/complete-python-bootcamp/learn/lecture/9478286#questions Object Oriented Programming (OOP) allows programmers to create their own objects that have4 methods and attributes. Recall that after defining a string, list, dictionary or other objects, you are able to call methods off them with the .method_name() syntax. These methods act ..

Read more

< Section 6 Section 8 > https://www.udemy.com/complete-python-bootcamp/learn/lecture/9442462#questions def check_win(mark, board): winpattern = mark * 3 #print(board[‘7’] + board[‘8’] + board[‘9’]) map=[board[‘7’] + board[‘8’] + board[‘9’], board[‘4’] + board[‘5’] + board[‘6’], board[‘1’] + board[‘2’] + board[‘3’], board[‘7’] + board[‘4’] + board[‘1’], board[‘8’] + board[‘5’] + board[‘2’], board[‘9’] + board[‘6’] + board[‘3’], board[‘7’] + board[‘5’] + board[‘3’], ..

Read more

Section 6 Menu < Section 5 Section 7 > Methods and Python Documentation Functions in Python Overview of Quick Function Exercises #1 – 10 *args and **kwargs in Python Function Practice Exercises – Overview Function Practice Exercises – Solutions Function Practice – Solutions Level One Function Practice – Solutions Level Two Function Practice Solutions – ..

Read more