Naxalov / string_length

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 and s2 . return their even lengths, example "s1". If there is no even length, return "s2".

Example 1:

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

Example 2:

Input: s1="coder" s2="example" 
Output: "coder"

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

if s1 is longer than s2 return s1 add to s2 otherwise return s1 itself

Example 1:

Input: s1 = "codeschool", s2 = "dart"
Output: "codeschooldart"

Example 2:

Input: num1 = "dart", num2 = "codeschool"
Output: "codeschool"

string_len10

return the given string to uppercase

Example 1:

Input: s = "codeschool"
Output: 'CODESCHOOL'

Example 2:

Input: s = "dart"
Output: 'DART'

Warning

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

About


Languages

Language:Dart 100.0%