# @ symbol = 64 and binary 0b110101 #print ord('@') #print bin(ord('@')) #list = [0,1,2] dictionary= {'a':0, 'b'=0} dict= {'cat':5} a='cat' dict[a]==5 dict={'a':0,'c':0,'d':0,'e':0} #print dict #how many of each letter is in the ' ' for char in 'aaaaaddeaaa': dict[char] += 1 print dict prices = {'apple': 0.60, 'banana': 0.80} print 'The price of one apple is $' + ('%.2f' % prices['apple']) print 'The price of two bananas is $' + ('%.2f' % (prices['banana'] *2)) # instant dictionary with all letters from string import ascii_lowercase dict = {} print ascii_lowercase for c in ascii_lowercase: dict[c] = 0 print dict #seperate thing str = raw_input() #str = 'aaa' for c in str: if c in dict.keys(): dict[c] += 1 print dict #Seperate for c in str: if c in dict.keys(): result = False if result ==False: print "Not a pangram" else: print "Yes a program"
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question