How to create columns dynamically

I find another solution, it is very easy.

x = st.slider('choose a number',1,5)

col1, col2, col3=st.beta_columns([2,0.2,2])
with col1:
	st.empty()
with col2:
	if x==1:
		st.markdown(":star:")
	if x==2:
		st.markdown(":star::star:")
	if x==3:
		st.markdown(":star::star::star:")
	if x==4:
		st.markdown(":star::star::star::star:")
	if x==5:
		st.markdown(":star::star::star::star::star:")
with col3:
	st.empty()