Ejemplo n.º 1
0
# SingPath's level_2 task
# Implementer: Abilkhayir Akhet
'''
Во 2 уровне решил не все подряд делать, а выборочно, так как выполнение определенных тасков
включает в себе выполнение более ранних тасков
'''

from commonmethods import get_task_description
from commonmethods import get_task_result
from commonmethods import put_empty_line
from commonmethods import get_level_number

get_level_number(2)
put_empty_line()

# task 5
get_task_description(5, 'Python Math')
a = 1
b = 2
c = a + b
get_task_result(5, c)
put_empty_line()

# task 6
get_task_description(6, 'More Python Math')
seconds_in_year = 60 * 60 * 24 * 365
get_task_result(6, seconds_in_year)
put_empty_line()

# task 7
'''
Ejemplo n.º 2
0
# SingPath's level_1 task
# Implementer: Abilkhayir Akhet

from commonmethods import get_task_description
from commonmethods import get_task_result
from commonmethods import put_empty_line
from commonmethods import get_level_number

get_level_number(1)
put_empty_line()

# task 1
get_task_description(1, 'Welcome task')
get_task_result(1, 'Here I don\'t have to type any code')
put_empty_line()

# task 2
get_task_description(2, 'Your First Program')
greeting = 'Hello World'
get_task_result(2, greeting)
put_empty_line()

# task 3
get_task_description(3, 'Starter Code')
bob = 'Thanks for the help'
get_task_result(3, bob)
put_empty_line()

# task 5
get_task_description(5, 'Still more variables')
name = 4.27
Ejemplo n.º 3
0
# SingPath's level_3 task
# Implementer: Abilkhayir Akhet
'''
В 3 уровне решил не все подряд делать, а выборочно, так как выполнение определенных тасков
включает в себе выполнение более ранних тасков
'''

from commonmethods import get_task_description
from commonmethods import get_task_result
from commonmethods import put_empty_line
from commonmethods import get_level_number
from commonmethods import get_rand_word

get_level_number(3)
put_empty_line()

import random
import math

# task1
get_task_description(1, 'Functions')
rand_number = random.randint(1, 9)


def square(int):
    return int * int


print('Input integer is: ' + str(rand_number))
get_task_result(1, square(rand_number))
put_empty_line()
Ejemplo n.º 4
0
# SingPath's level_4 task
# Implementer: Abilkhayir Akhet

'''
В 4 уровне решил не все подряд делать, а выборочно, так как выполнение определенных тасков
включает в себе выполнение более ранних тасков
'''

from commonmethods import get_task_description
from commonmethods import get_task_result
from commonmethods import put_empty_line
from commonmethods import get_level_number

get_level_number(4)
put_empty_line()

# task 1
get_task_description(1, 'Find the quotient')

def quotient(a, b):
    return int(a/b)


get_task_result(1, quotient(9, 3))
put_empty_line()

#task 2
get_task_description(2, 'Find the remainder')

def get_remainder(a, b):
    return int(a%b)
Ejemplo n.º 5
0
# SingPath's level_6 task
# Implementer: Abilkhayir Akhet
'''
В 6 уровне решил не все подряд делать, а выборочно, так как выполнение определенных тасков
включает в себе выполнение более ранних тасков
'''

from commonmethods import get_task_description
from commonmethods import get_task_result
from commonmethods import put_empty_line
from commonmethods import get_level_number

get_level_number(6)
put_empty_line()

#task1
get_task_description(1, 'Strings')


def get_nth_char_in_string(string, index):
    return string[index]


get_task_result(1, get_nth_char_in_string('success', 4))
put_empty_line()

#task2
get_task_description(2, 'Hello')


def get_greeting(name):
Ejemplo n.º 6
0
# SingPath's level_5 task
# Implementer: Abilkhayir Akhet
'''
В 5 уровне решил не все подряд делать, а выборочно, так как выполнение определенных тасков
включает в себе выполнение более ранних тасков
'''

from commonmethods import get_task_description
from commonmethods import get_task_result
from commonmethods import put_empty_line
from commonmethods import get_level_number

get_level_number(5)
put_empty_line()

import random
import math

# task 1
get_task_description(1, 'While Loop')


def get_sum_using_while_loop(number):
    count = 0
    sum = 0
    while (count < number):
        count += 1
        sum += count

    return sum
Ejemplo n.º 7
0
# SingPath's level_7 task
# Implementer: Abilkhayir Akhet
'''
В 7 уровне решил не все подряд делать, а выборочно, так как выполнение определенных тасков
включает в себе выполнение более ранних тасков
'''

from commonmethods import get_task_description
from commonmethods import get_task_result
from commonmethods import put_empty_line
from commonmethods import get_level_number

get_level_number(7)
put_empty_line()

#task1
get_task_description(1, 'Lists')


def create_list():
    list = [0, 1, [2, 4], 4]
    return list


get_task_result(1, create_list())
put_empty_line()

#task2
get_task_description(2, 'List Head')

Ejemplo n.º 8
0
# SingPath's level_8 task
# Implementer: Abilkhayir Akhet
'''
В 8 уровне решил не все подряд делать, а выборочно, так как выполнение определенных тасков
включает в себе выполнение более ранних тасков
'''

from commonmethods import get_task_description
from commonmethods import get_task_result
from commonmethods import put_empty_line
from commonmethods import get_level_number

get_level_number(8)
put_empty_line()

#task1
get_task_description(1, 'Dictionaries')
dictionary = {"color": "blue", 7: "seven", 3.14: [3, 1, 4, 6]}
get_task_result(1, dictionary)
put_empty_line()

#task2
get_task_description(2, 'List the keys of a dictionary')


def sort_dictioary_keys(dict):
    return sorted(list(dict.keys()))


get_task_result(2, sort_dictioary_keys({'a': 1, 'c': 2, 'b': 3}))
put_empty_line()