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
| import datetime | |
| class Student(): | |
| def __init__(self, name, dob, number): | |
| self.name = name | |
| self.birth_date = dob | |
| self.phone_number = number | |
| def age_calculator(self): | |
| current_date = datetime.datetime.now().date() |
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
| #!/usr/bin/env python3 | |
| from math import inf as infinity | |
| from random import choice | |
| import platform | |
| import time | |
| from os import system | |
| """ | |
| An implementation of Minimax AI Algorithm in Tic Tac Toe, | |
| using Python. |
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
| from tkinter import * | |
| from tkinter import messagebox | |
| Player1 = 'X' | |
| stop_game = False | |
| def clicked(r, c): | |
| # player | |
| global Player1 |
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
| import random | |
| class TicTacToe: | |
| def __init__(self): | |
| self.board = [] | |
| def create_board(self): | |
| for i in range(3): |
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
| import threading | |
| import pygame | |
| class Ball: | |
| xd = 1 | |
| yd = 1 | |
| def __init__(self, x, y, color, xd, yd): | |
| self.x = x | |
| self.y = y | |
| self.color = color |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 Car: | |
| def __init__(self, speed=0): | |
| self.speed = speed | |
| self.odometer = 0 | |
| self.time = 0 | |
| def say_state(self): | |
| print("I'm going {} kph!".format(self.speed)) |
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
| # Класс Employee: name, money | |
| class Employee: | |
| def getSalary(self): | |
| return self.money | |
| def setSalary(self, money): | |
| self.money = money | |
| def __init__(self, name): | |
| self.name = name |
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
| import requests | |
| import pandas as pd | |
| import lxml | |
| url = 'https://www.opennet.ru' | |
| html = requests.get(url).content | |
| df_list = pd.read_html(html) | |
| news = df_list[2] | |
| ln = list(news[2].dropna()) |
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
| # написать функцию, которая суммирует элементы списка чисел | |
| # 1. С помощью цикла | |
| # 2. С помощью рекурсии | |
| def sumLoop(lst): | |
| sum = 0 | |
| for i in lst: | |
| sum += i | |
| return sum |
NewerOlder