Skip to content

Python-2022I/str_while_loop_homework

Repository files navigation

Welcome

LIST Indexing

Automated grading of homework assignments and tests

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

Problems

While01

A variable of type str is given. Find how many numbers it contains and return.

Example 1:

Input: s = "python 2022"
Output: 4

Example 2:

Input: s = "e324xE"
Output: 3

Constraints:

  • 1 <= length(s) <= 10^5

While02

A variable of type str is given. Find how many letters it contains and return.

Example 1:

Input: s = "Python 2022"
Output: 6

Example 2:

Input: s = "e324xE"
Output: 3

Constraints:

  • 1 <= length(s) <= 10^5

While03

A variable of type str is given. Find how many punctuations it contains and return.

Example 1:

Input: s = "#hashtag@$"
Output: 3

Constraints:

  • 1 <= length(s) <= 10^5

While04

A variable of type str is given. Find how many uppercase letters there are and return.

Example 1:

Input: s = "CodeschoolUz"
Output: 2

Constraints:

  • 1 <= length(s) <= 10^5

While05

A variable of type str is given. Find how many lowercase letters there are and return.

Example 1:

Input: s = "CodeschoolUz"
Output: 10

Constraints:

  • 1 <= length(s) <= 10^5

While06

A variable of type str is given. Find and return how many consonant letters there are.

Example 1:

Input: s = "CodeschoolUz"
Output: 7

Constraints:

  • 1 <= length(s) <= 10^5

While07

A string of numbers is given. Find how many even numbers there are and return.

Example 1:

Input: s = "56786543250"
Output: 6

Example 2:

Input: s = "123456"
Output: 3

Constraints:

  • 1 <= length(s) <= 10^5

While08

A string of numbers is given. Find how many odd numbers there are and return.

Example 1:

Input: s = "1567534"
Output: 5

Example 2:

Input: s = "3489769"
Output: 4

Constraints:

  • 1 <= length(s) <= 10^5

While09

A string of numbers is given. Find the sum of all the numbers and return.

Example 1:

Input: s = "987654"
Output: 39

Example 2:

Input: s = "12"
Output: 3

Constraints:

  • 1 <= length(s) <= 10^5

While10

A string of numbers is given. Find and return the sum of all odd numbers.

Example 1:

Input: s = "589765"
Output: 26

Example 2:

Input: s = "98421"
Output: 10

Constraints:

  • 1 <= length(s) <= 10^5

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