I can recommend going over this book to get more familiar with how things work in R:
Specifically chapter on functions might be useful for you:
As is, your function won't work since you have a mistake in symbols <- line. If you correct this mistake, it works exactly as you expect:
set.seed(42)
get_symbols<-function(){
wheel <- c("DD", "7","BBB","BB","B", "C","0")
sample(wheel, size = 3, replace=TRUE, prob =c(0.03, 0.03, 0.06, 0.1, 0.25, 0.01, 0.52))
}
get_symbols()
#> [1] "BBB" "DD" "0"
symbols <- get_symbols()
symbols
#> [1] "BB" "B" "0"
Created on 2020-04-30 by the reprex package (v0.3.0)