- Text Content Generator - http://www.lipsum.com
- Favicon Generator - http://tools.dynamicdrive.com/favicon
- Data Generator - https://mockaroo.com/
- Mobile Mockup Generator - https://mockuphone.com
- Logo Generator - https://www.logaster.com
- UUID Generator - https://www.uuidgenerator.net/
- Hash Generator - https://passwordsgenerator.net/sha256-hash-generator/
- Ultimate Code Generator - https://webcode.tools/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Worker: | |
def __init__(self, name, pay): | |
self.name = name | |
self.pay = pay | |
def firstName(self): | |
return self.name.split()[0] | |
def giveRaise(self, percent): | |
self.pay *= (1.0 + percent) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# There are three ways to tests type in python | |
L = [None] | |
# using type syntx | |
if type(L) == type([]): | |
print('yup') | |
# using type name | |
if type(L) == list: | |
print('yup') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tuples are sequences, like lists, but they are immutable, like strings | |
# Syntactically, they are normally coded in parentheses instead of square brackets, | |
# and they support arbitrarytypes, arbitrary nesting, and the usual sequence operations. | |
# A Tuple and its length is as below | |
T = (1, 'a', 2, 'b', 3, 'c') | |
print (T) | |
print(len(T)) | |
# Indexing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Importing builtin Libraries | |
import math | |
import random | |
import sys | |
import re | |
# Printing System Detail | |
print (sys.platform) | |
# Two raised to the power hundred |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sets are unordered collections of unique and immutable objects, sets are useful for common tasks | |
# such as filtering out duplicates, isolating differences, and performing order-neutral | |
# equality tests without sorting in lists, strings, and all other iterable objects | |
# Creating sets --> set('elements') or {'elements'} | |
X = set("ahmed") | |
print(X) | |
Y = {'z', 'a', 'h', 'i', 'd'} | |
print(Y) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Creating a list | |
L = [123, 'spam', 1.23] | |
print(L) | |
print(len(L)) | |
# Indexing | |
print(L[0]) | |
# slicing | |
print(L[:1], L[:-1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tkinter import * | |
from tkinter import ttk | |
from tkinter import messagebox | |
class Feedback: | |
'''This is a form for fun''' | |
def __init__(self, master): | |
master.title('Feedback') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Creating a text file --> open('filename.type', 'w') --> 'w' is write | |
# Creating a text file --> open('filename.type', 'r') --> 'r' is read | |
f = open('name.txt', 'w') | |
# Writing data --> always remain string type in document | |
f.write('Allah\nis\nall\nseeing') | |
# Flush buffers the output data to your hard drive | |
f.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Dictionaries are not a sequences but are 'mapping' | |
D = {'food': 'spam', 'quantity': 4, 'colour': 'pink'} | |
print(D) | |
# Changing and calling values is as below | |
print(D['food']) | |
D['quantity'] += 1 | |
print(D) | |
D['food'] = 'jam' |
NewerOlder