This file contains hidden or 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
| print('Input file name: ') | |
| filename = input() | |
| fin = open(filename, 'r') | |
| text = [line.split() for line in fin.readlines()] | |
| countWord = {} | |
| for words in text: | |
| for word in words: | |
| try: | |
| countWord[word]+=1 | |
| except KeyError: |
This file contains hidden or 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
| words = input(); | |
| listwords = len(set(words.split())); | |
| print(listwords); |
This file contains hidden or 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
| a = gets | |
| puts a |
This file contains hidden or 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 |
This file contains hidden or 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
| переменная.to_i #integer | |
| переменная.to_f #float | |
| переменная.to_s #string |
This file contains hidden or 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
| x=5 | |
| puts "x=#{x}" |
This file contains hidden or 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
| n = 10 #колличество | |
| n.times{ | |
| |#номер итерации| | |
| #блок кода | |
| } |
This file contains hidden or 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
| @table = ['-','-','-','-','-','-','-','-','-'] | |
| def cells_show | |
| puts "Number of cells:" | |
| puts "-1-|-2-|-3-" | |
| puts "-4-|-5-|-6-" | |
| puts "-7-|-8-|-9-" | |
| puts "Current situation:" | |
| puts "-#{@table[0]}-|-#{@table[1]}-|-#{@table[2]}-" | |
| puts "-#{@table[3]}-|-#{@table[4]}-|-#{@table[5]}-" |
This file contains hidden or 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 Airport | |
| attr_reader :name | |
| attr_reader :planes | |
| def initialize(name) | |
| @name = name | |
| @planes = [] | |
| end | |
| def add_plane plane |
This file contains hidden or 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
| document.onkeyup = KeyCheck; | |
| function openTab(url) { | |
| window.open(url, "_blank"); | |
| } | |
| function linkTrue(li) { | |
| var online = "icon_mess_blink"; | |
| if(li.getElementsByClassName("icon_mess_blink").length !== 0){ |
OlderNewer