Skip to content

Commit

Permalink
Updated main (#11)
Browse files Browse the repository at this point in the history
* Added additional One liner and also replaced `.sort()` with `sorted()` as the latter will return the list.

---------

Co-authored-by: Claes Gill <claes@claesgill.com>
  • Loading branch information
faranbutt and claesgill committed Oct 24, 2023
1 parent 280b8f7 commit d17d9b9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
alphabet = [ chr(ord("a") + i) for i in range(26) ] # list of the alphabet (a-z)
reversed_alphabet = alphabet[::-1]
sorted_alphabet = alphabet.sort()
sorted_alphabet = sorted(alphabet)
numbers_alphabet = [*(chr(ord("0") + i) for i in range(10)), *alphabet] # concatenate numbers and alphabets into 1 array (0-9,a-z)
numbers42_alphabet = [(int(i) * 42) for i in numbers_alphabet[0:9]] + alphabet
alphabet_capatalized = [*(chr(ord("A") + i) for i in range(26))]
sum_of_numbers_0_to_100 = sum(range(101))#sum of numbers 0-100
sum_of_numbers_0_to_100 = sum(range(101)) # sum of numbers 0-100
combined_characters = [chr(ord("a") + i) for i in range(26)] + [chr(ord("A") + i) for i in range(26)] + [chr(ord("0") + i) for i in range(10)] # Returns Capital letters,Small Letters and numbers combined (a-z,A-Z,0,9)

0 comments on commit d17d9b9

Please sign in to comment.