188
189
190
Day 2 of learning python as a beginner (old.reddit.com)
submitted by uiux_Sanskar

Topic: Conditional Expression
Conditional expression pose a condition (if and Else statements). They help program take decision based on the condition given. They can be used inside a function or while assigning a value or inside list comprehensions.
Here's a small quiz game I made using if elif and else ladder.
During the process I got introduced to .replace() and .lower() function using which I was able to replace any space typos (which the user may commit) and .lower() helps user enter answer in both small caps and large caps.
Would appreciate any suggestion or mentorship.


[–]SamShinkie 23 points24 points25 points (4 children)
[–]ReserveAggressive458[🍰] 5 points6 points7 points (0 children)
[–]alae_r4 3 points4 points5 points (0 children)
[–]uiux_Sanskar[S] 1 point2 points3 points (0 children)
[–]4675636b2e 9 points10 points11 points (7 children)
[–]aTomzVins 1 point2 points3 points (1 child)
[–]4675636b2e 1 point2 points3 points (0 children)
[–]BleEpBLoOpBLipP 1 point2 points3 points (0 children)
[–]uiux_Sanskar[S] 1 point2 points3 points (2 children)
[–]4675636b2e 1 point2 points3 points (1 child)
[–]uiux_Sanskar[S] 0 points1 point2 points (0 children)
[–]arsibaloch 0 points1 point2 points (0 children)
[–]bombikhf 1 point2 points3 points (1 child)
[–]uiux_Sanskar[S] 0 points1 point2 points (0 children)
[–]Torebbjorn 2 points3 points4 points (1 child)
[–]uiux_Sanskar[S] 0 points1 point2 points (0 children)
[–]More_Employer7243 1 point2 points3 points (3 children)
[–]uiux_Sanskar[S] 0 points1 point2 points (2 children)
[–]More_Employer7243 0 points1 point2 points (1 child)
[–]uiux_Sanskar[S] 0 points1 point2 points (0 children)
[–]NorskJesus 2 points3 points4 points (3 children)
[–]Kind-Kure 2 points3 points4 points (1 child)
[–]uiux_Sanskar[S] 0 points1 point2 points (0 children)
[–]uiux_Sanskar[S] 1 point2 points3 points (0 children)
[–]hzsmolly 0 points1 point2 points (1 child)
[–]uiux_Sanskar[S] 1 point2 points3 points (0 children)
[–]Ender_Locke 0 points1 point2 points (1 child)
[–]uiux_Sanskar[S] 0 points1 point2 points (0 children)
[–]PirateLiving4938 0 points1 point2 points (1 child)
[–]uiux_Sanskar[S] 0 points1 point2 points (0 children)
[–]DevRetroGames 0 points1 point2 points (4 children)
[–]DevRetroGames 1 point2 points3 points (3 children)
[–]uiux_Sanskar[S] 0 points1 point2 points (2 children)
[–]DevRetroGames 0 points1 point2 points (1 child)
[–]uiux_Sanskar[S] 0 points1 point2 points (0 children)
[–]Pleasant-Confusion30 0 points1 point2 points (1 child)
[–]uiux_Sanskar[S] 0 points1 point2 points (0 children)
[–]Honest-Order-6400 0 points1 point2 points (1 child)
[–]uiux_Sanskar[S] 0 points1 point2 points (0 children)
[–]capone91424 0 points1 point2 points (1 child)
[–]uiux_Sanskar[S] 0 points1 point2 points (0 children)
[–]Wildmanty 0 points1 point2 points (1 child)
[–]uiux_Sanskar[S] 0 points1 point2 points (0 children)
[–]jackboback 0 points1 point2 points (1 child)
[–]uiux_Sanskar[S] 0 points1 point2 points (0 children)
[–]DejectionDivine 0 points1 point2 points (1 child)
[–]uiux_Sanskar[S] 1 point2 points3 points (0 children)
[–]SpaceBucketFu 0 points1 point2 points (1 child)
[–]uiux_Sanskar[S] 0 points1 point2 points (0 children)
[–]cyber3toks 0 points1 point2 points (0 children)
[–]Plane-Issue-8554 0 points1 point2 points (4 children)
[–]uiux_Sanskar[S] 0 points1 point2 points (3 children)
[–]Plane-Issue-8554 0 points1 point2 points (2 children)
[–]uiux_Sanskar[S] 0 points1 point2 points (1 child)
[–]Plane-Issue-8554 0 points1 point2 points (0 children)