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
import sys | |
word_list = [i[:-1] for i in sys.stdin.readlines() ] | |
for i in range(len(word_list)): | |
print("{}{}".format(" " * i if i != 0 else "", word_list[i])) | |
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
age_list = list(map(int, input().split(" "))) | |
def oldest(anton, boris, victor): | |
if anton == boris == victor: | |
return "Same age" | |
elif anton == max(age_list): | |
return (anton == boris and "Victor") or (anton == victor and "Boris") or "Anton" |
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 ctypes import * | |
aa = int(input()) | |
def find_temp(a): | |
return int((a * 1.8) + 32) | |
bb = c_int().value = find_temp(aa) |
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 Role(models.Model): | |
""" | |
Role model. Used as a model to group user to specific group depending on their type of work | |
""" | |
name = models.CharField(max_length=50) | |
def __str__(self): | |
return self.name |
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 django.urls import path, include | |
from rest_framework.routers import DefaultRouter | |
from . import views | |
# router = DefaultRouter() | |
# router.register(r"roles", views.RoleViewSet) | |
urlpatterns = [ | |
path("roles/", views.RoleViews.as_view(), name="roles") | |
] |
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
import java.util.Scanner; | |
public class GroupC1 { | |
public static void main(String[] args) { | |
Scanner input = new Scanner(System.in); | |
int n = input.nextInt(); | |
for (int i = 1; i <= n; i++) { |
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
public class ISBNreader { | |
public boolean isValid(String string) { | |
String n2 = string.replaceAll("-", ""); | |
int result = 0; | |
if (n2.length() != 10) { | |
return false; | |
} |
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
import java.util.Arrays; | |
class Matrix { | |
private int[][] a; | |
Matrix(String matrixAsString) { | |
String[] rows = matrixAsString.split("\\n+"); | |
int ncols = rows[0].split("\\s+").length; | |
a = new int[rows.length][ncols]; | |
for (int i = 0; i < rows.length; i++) { |
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
serializer = QuestionSerializer(events) | |
serializer.is_valid() | |
return Response(serializer.data) |
OlderNewer