Skip to content

group-2022B/string_len_homework

Repository files navigation

Welcome

String len

Automated grading of homework assignments and tests

  • fork this repository
  • solve the task
  • commit with proper message

Problems

string_len01

A variable of type string is given. Find its length.

Example 1:

Input: a="python"
Output: 6

Constraints:

string_len02

A string type variable is given. Return True if its length is even. Return False if its length is odd.

Example 1:

Input: a="code"
Output: True

string_len03

String type variables a and b are given. Return True if the length is equal. If not equal, return False.

Example 1:

Input: a="code" b="exam"
Output: True

Example 2:

Input: a="code" b="python"
Output: False

string_len04

A string variable s is given. Return the "*" sign that is equal to the length of this variable.

Example 1:

Input: a="code"
Output: "****"

string_len05

Given two strings, s1 and s2. Find their total length.

Example 1:

Input: s1="code" s2="python"
Output: 10

string_len06

Given two strings, s1 and s2. Return the shortest length between them.

Example 1:

Input: s1="code" s2="python"
Output: "code"

Example 2:

Input: s1="code" s2="exam"
Output: "exam"

string_len07

Given three strings, s1, s2 and s3. return their odd lengths, example "[s1, s2]". If there is no odd length, return "[]".

Example 1:

Input: s1="code" s2="python" s3="coder"
Output: "[coder]"

Example 2:

Input: s1="codeschool.uz" s2="example" s3="python"
Output: "[codeschool.uz, example]"

string_len08

Given variable type string s. Return the character in the muddle. If the length is even, return two characters in the middle.

Example 1:

Input: s = "abcdf"
Output: "c"

Example 2:

Input: s = "cool
Output: "oo"

Constraints:

  • 2 < len(s)

string_len09

Given two non-negative integers, num1 and num2 represented as string. Return the sum of num1 and num2 as a string.

Example 1:

Input: num1 = "12", num2 = "5"
Output: "17"

Example 2:

Input: num1 = "425", num2 = "81"
Output: "506"

Constraints:

  • 1 <= len(num1), len(num2) <= 10^4

string_len10

A string of length three is given. Check that it is a palindrome. Return True if the palindrome is False otherwise.

Example 1:

Input: s = "cff"
Output: False

Example 2:

Input: s = "dcd"
Output: True

Constraints:

  • len(s) == 3

Warning

  • don't copy other solutions or any solution
  • don't remove comments

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages