Skip to content

Commit f6e2483

Browse files
committed
restructured
1 parent c356835 commit f6e2483

File tree

6 files changed

+59
-16
lines changed

6 files changed

+59
-16
lines changed

Character Counter/README.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
11
Simple Programs in Python
2+
3+
# Character Counter
4+
5+
- Counts number of times each character occurs in input string.
6+
- Space is also taken as character
7+
- For example, you enter "sass" => s: 3, a: 1
8+
- Read about pprint [here](https://docs.python.org/3/library/pprint.html)
9+
10+

RockPaperScissors.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/python3
2+
3+
from random import randint
4+
5+
def rps():
6+
playerCh = input('Choose rock, paper or scissors')
7+
print('You chose '+playerCh)
8+
9+
computerCh = randint(1,3)
10+
11+
if computerCh == 1:
12+
computerCh = 'rock'
13+
print('Computer chose '+ computerCh )
14+
elif computerCh == 2:
15+
computerCh = 'paper'
16+
print('Computer chose '+ computerCh )
17+
else:
18+
computerCh = 'scissors'
19+
print('Computer chose '+ computerCh )
20+
return(computerCh, playerCh)
21+
22+
c, p = rps()
23+
24+
if c == p:
25+
print('Tie')
26+
elif c == 'rock' and p == 'paper':
27+
print('Player Wins')
28+
elif c == 'rock' and p == 'scissors':
29+
print('Computer Wins')
30+
elif c == 'paper' and p == 'rock':
31+
print('Computer Wins')
32+
elif c == 'paper' and p == 'scissors':
33+
print('Player Wins')
34+
elif c == 'scissors' and p == 'rock':
35+
print('Player Wins')
36+
elif c == 'scissors' and p == 'paper':
37+
print('Computer Wins')
38+
39+
40+
41+
42+
43+
44+
45+
46+
47+
48+
49+
50+
File renamed without changes.

TicTacToe/README.md

Lines changed: 0 additions & 9 deletions
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)