Skip to content

CharlotteAnning/Python

Repository files navigation

Python

This is the repository showcasing some of my work with python :)

All functions can be found in the scripts directory above so feel free to have a go!

Contents

Longest Substring

example usage:

>>>longest_substring("This is a test string!")
the longest substring in "This is a test string" without repeats is: "string"

Reverse String

example usage:

>>> reverse_string("hello world")
'dlrow olleh'

Anagram

example usage:

>>> anagram('silent', 'listen')
silent is an anagram of listen!
>>> anagram('hello', 'world')
hello and world are not anagrams of eachother :(

Largest Element

example usage:

>>> largest_element([4, 9, 3, 7, 2, 5, 10])
the largest number in your list is 10!

Vowel and Consonants

example usage:

>>> vowel_and_consonants('hippopotamus!')
your word has 1 non alphabetical characters :)
your word has 5 vowels and 7 consonants
>>> vowel_and_consonants('hippopotamus')
your word has 5 vowels and 7 consonants

Missing Number

example usage:

>>> missing_number([1, 3, 5, 7, 11, 13, 15, 17, 19, 21, 23])
The missing number is: 9
>>> missing_number([1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23])
There is no missing number!

Numbers Sum

example usage:

>>> numbers_sum("19", [8,3,5,6,7,23,42,5,7,3,9,10,5,14,13])
9 + 10 = 19
6 + 13 = 19
5 + 14 = 19

Note that the function doesnt also print 10 + 9 aswell as 9 + 10 which the older version was doing, also 5 is in the list three times so older versions printed 5 + 14 three times (combatted this with the set() function) and the number given by the user can be a string or float

About

This is the repository showcasing some of my work with python :)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages