-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2bacd2e
commit 6ce0c22
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# The following program scrambles a string, leaving the first and last letter be | ||
# the user first inputs their string | ||
# the string is then turned into a list and is split apart | ||
# the list of characters are scrambled and concatenated | ||
|
||
import random | ||
|
||
print("this program wil take a word and will scramble it \n") | ||
word = input("enter the word\n") | ||
|
||
word_list = list(word) | ||
|
||
for i in range(len(word_list)): | ||
random.shuffle(word_list[1:-1]) | ||
|
||
scrambled_word = "".join(word_list) | ||
|
||
print(scrambled_word) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# tutorial 2 - practice | ||
|
||
num = int(input("enter an integer to be converted to binary\n")) | ||
|
||
bin_num = bin(num) | ||
|
||
print(bin_num) | ||
|