shayman23
New Coder
Suppose every day you wake up and you are randomly in a GOOD mood 60% of the time or in a BAD mood 40% of the time. Furthermore, anytime you have a quiz or test in a course, the grade you receive is also random based on the following:
If you take a quiz or exam when you are in a GOOD mood,
I need help in taking this code from r and converting it to Python.
Thanks
If you take a quiz or exam when you are in a GOOD mood,
- you get a 100 on 80% of such days
- you get a 75 on 20% of such days
- you get a 100 on 20% of such days
- you get a 75 on 30% of such days
- you get a 50 on 50% of such days
Code:
GorBday <- sample(c("Good", "Bad"), size=1, prob=c(0.60, 0.40))
## This is the code to determines test scores on good days
GoodDayTscore <- sample(c("100", "75"), size=1, prob=c(0.80, 0.20))
GoodDayTscore
## This is the code that determines test scores on bad days
BadDayTscore <- sample(c("100", "75", "50"), size=1, prob=c(0.20, 0.30, 0.50))
BadDayTscore
I need help in taking this code from r and converting it to Python.
Thanks