Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelTennyson authored Jan 16, 2020
1 parent 2bacd2e commit 6ce0c22
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lab3(practice).py
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)
8 changes: 8 additions & 0 deletions tut2(practice).py
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)

0 comments on commit 6ce0c22

Please sign in to comment.