File tree 4 files changed +49
-0
lines changed
4 files changed +49
-0
lines changed Original file line number Diff line number Diff line change
1
+ text = input ("camelCase: " )
2
+ output = ""
3
+
4
+ for char in text :
5
+ if char .isupper ():
6
+ output += '_' + char .lower ()
7
+ else :
8
+ output += char
9
+ print ("snake_case:" , output )
Original file line number Diff line number Diff line change
1
+ due = 50
2
+
3
+ while True :
4
+ print ("Amount Due:" , due )
5
+ money = int (input ("Insert Coin: " ))
6
+ if money == 25 or money == 10 or money == 5 :
7
+ if (money >= due ):
8
+ print ("Change Owed:" , money - due )
9
+ break
10
+ due -= money
11
+ else :
12
+ continue
Original file line number Diff line number Diff line change
1
+ def main ():
2
+ plate = input ("Plate: " )
3
+ if is_valid (plate ):
4
+ print ("Valid" )
5
+ else :
6
+ print ("Invalid" )
7
+
8
+
9
+ def is_valid (s ):
10
+ if s [0 :2 ].isalpha () and len (s )< 7 and s [- 1 ].isnumeric ():
11
+ return True
12
+
13
+ main ()
Original file line number Diff line number Diff line change
1
+ def main ():
2
+ text = input ("Input: " )
3
+ output = ""
4
+
5
+ for i in text :
6
+ if isnotvowel (i ):
7
+ output += i
8
+
9
+ print (f"Output: { output } " )
10
+
11
+ def isnotvowel (n ):
12
+ if n not in 'aeiouAEIOU' :
13
+ return True
14
+
15
+ main ()
You can’t perform that action at this time.
0 commit comments